The heart is a common item in many video games. It can be picked up to restore health.
Sometimes hearts are used to show a kiss or an infatuated character in games where the graphics are not sophisticated enough to animate these actions. In some games, hearts are used in attack animations for female characters, such as Sexy Silvia's gun (which fires a glowing heart) or Amy Rose's Piko Piko Hammer (which explodes into hearts on impact.)
But typically, if you see a heart just laying around in any video game, pick it up. As a rule, hearts are always good.