I've had palpitations before. It can be a sign of stress or anxiety, amongst other things, but is rarely a sign of heart problems (I've been to the Dr and have a full Bupa health check every 2 years).
I most often get it now as part of a hangover. It's to do with blood pressure and your body needing to fast track blood around in a bid to clean itself. It started when I hit 30.
Go to the Dr as it'll put your mind at rest - and stressing out about it will make it worse. If your heart was in trouble you wouldn't be getting palpitations, you'd be in agony and puking up.