I don't know how old your post is but as I'm seeing it now I'm going to give you the little information I have.
The heart system is meant to make you pay more attention to your spellings, grammar and sentence structure.
You only get the 5 hearts!
Once lost there are a few options for refill because you cannot move forward without them.
You can either:
Wait several hours for them to refill on their own,
You can purchase a refill during the lesson (an option pops up). If you don't you have to "quit the lesson",
You can opt in for Plus
or (and this is my preference)
- You can do the 1 heart replacement lesson, which is a simple lesson to replenish your loss. I do these when I'm down to 1 heart because you are offered another heart if you watch an ad. Do it twice and you have 5 total when you're done and you avoid having to "quit" the lesson over something as silly as a misspelled name.
I find them annoying, especially when you've made a dumb mistake and lost your last heart for it with one lesson left, but they force me to do practices, which I often feel I need.
When you run out of hearts you can do a one heart practice (option at top right) which focuses on the areas Duo thinks you have trouble. You can get two hearts out of the deal, after an ad, plus xp points.
You can pay in gems to refill your hearts but I think it's more useful to do the practice.