When I was 23, I suddenly developed heart palpitations a few weeks after the unexpected death of a beloved grandmother. They happened at least a couple of times a day, often when I was trying to sleep or was otherwise being still and quiet.
I could always feel one coming on: there would be a strangely anxious, squeezing sensation in my chest and I could tell that my heart had "paused"... A few seconds later, I'd feel it kick back in again with a very deep, heavy thump. It was disturbing, so I did finally see my doctor and had an ECG, but there was no abnormality found, at least nothing that he felt the need to tell me about. (Actually, prior to and during most of that time, I'd been exercising regularly, eating well, and was in the best shape I'd ever been.)
About three years after they'd begun, the palpitations had completely stopped. I believe that the shock and stress of losing the grandmother I'd loved so deeply is what had induced them. Emotionally-speaking, her death had broken my heart, so I suppose it's not out of the question that it would react in some way. Also, I'd been holding in my grief by avoiding thinking and talking about her; it seemed too overwhelming at the time. Intense emotions do have a habit of getting expressed, however, one way or another.
In any case, the important thing is that you see a doctor. There's a good chance that your palpitations are caused by anxiety or some other emotional upset(s), but there's also a chance that they aren't...
Simply dismissing them would be foolish, especially if they're becoming more frequent. Building up worry about your health definitely won't help either, so find out for sure. Good luck.