Hearts are used to play a stage. If not stated otherwise in the stage start screen, all stages require one heart to play.
There are two separate counters for hearts. The first one replenishes itself every 30 minutes, up to a max of 5. Hearts from other sources, such as from clearing Mega Pokémon stages and from Mini Hearts sent from Facebook friends (only on Mobile), can go over this limit. The second one does not replenish itself, and is increased from purchasing from the Jewel Shop and from StreetPass tag bonuses (only on 3DS).