Hearts are like 'lives' and are used to replay a level that was a little tough and wasn't completed. You can have a maximum of 5 hearts at a time.