The heart icon in the upper left-hand corner of your screen displays how many lives you have. You can have a maximum of 5 lives, and 1 life is lost each time you are unable to beat a level.
You gain a life every 30 minutes (up to the maximum of 5). A timer next to the heart icon shows how long until a lost life is refilled. You can also replenish your lives instantly by using coins or getting an unlimited lives reward from chests!