There are two kinds of lives: single-use hearts and time-limited infinite lives.
By default, you have 5 hearts (lives). You lose a heart if you fail a level or quit the game without finishing a level.
If you have an active timer for infinite lives, then you have an unlimited number of lives available for a certain amount of time. In other words, you do not lose a life if you lose a level for that period. The infinite lives timer cannot be paused, so it keeps counting down even if you quit the game.