Each townsfolk has two different stats that matter for dating, their Level and their Hearts. These two stats are inconsistently named in the game code and around community resources like the wiki, so I'll define what I'm referring to in this guide when I use those terms.
Level ranges from 1 to 99 and is shown leveling up at the end of each day. This is what is increasing when you see hearts bubble up over the townsfolk's heard when you are talking to them or hanging out with them.
Hearts are never shown as a number in the game. They range from 0 to 10 and are not shown at the end of the day. The only way to see them in-game is to open the journal. The hearts will be represented graphicly as ten hearts that are either lit or dim. The 6th, 8th, and 10th hearts are a slightly different color to indicate when the three dates occur. The only ways to increase a townsfolk's Hearts are to select the "Flirt" option or go on a date.
=FLIRTING AND DATING=
Once a townsfolk reaches Level 20, there will be a 1 in 3 chance each day of the "Compliment" option being replaced by either "Flirt" or "Date" depending on the current number of Hearts. Selecting "Flirt" will immediately increase the townsfolk's Hearts by one. At 5, 7, and 9 Hearts, the "Date" option will show instead. One Heart will be added during the dating cutscene (not when clicking the "Date" button).
You can only use the compliment/flirt/date option once per day. Once you use it on a townsfolk, you won't see those options on any other townsfolk until the next day.
Once 10 Hearts are reached, "Flirt" and "Date" will not appear, but "Propose" will be available if the Wedding Ring has been purchased from the Auction House.
If the townsfolk reaches Level 50, then the flirt/date options will appear every day instead of having a 1 in 3 chance. This is unlikely to ever happen during an optimized speedrun unless you are running a longer category. If you're not trying to get the townsfolk to Level 50, then there is no further benefit to increasing the townsfolk's Level once they reach Level 20.
=SPEEDRUNNING STRATEGY=
You'll want to get the townsfolk you intend to marry to Level to 20 as fast as possible. Do this by talking to them and complimenting them every day. Hanging out is also effective and will get free money.
When talking to them, make sure the hearts are appearing over their head. If they are annoyed that you haven't built or done something, they may not be gaining levels. One example is that once you have the blueprint for the Office, Willow will complain that you haven't built it yet until you see the cutscene inside it (It is safe to destroy it once you see the cutscene).
Once they reach Level 20, selecting the "Talk", "Hang Out", and "Compliment" options is a waste of time (although hanging out may still be useful for the Dewdrops). The only options you'll want to select are "Flirt" and "Date". It's normal for there to sometimes be a span of several days when these options don't appear. It's a 1 in 3 chance every day and sometimes you'll get several bad rolls in a row.
To save a little time and frustration, don't interact with them on the last day (28th) of the season if the next option will be "Date". You can flirt on the last day of the season, but the game won't let you schedule a date. You'll need to keep track of their Hearts to know when to expect the dates.
Once they reach 10 hearts (immediately after the 3rd date), there is no longer a reason to interact with them at all until you have the wedding ring and are ready to propose. If you obtain the wedding ring before the third date, you will need to sleep after the date before proposing.