It's fairly normal to feel breathless after an orgasm.
Do you feel shortness of breath at any other time - after any other kind of exertion, like walking, running, any kind of exercise or physical activity?
Do you feel panic? Anxiety? Feeling short of breath can cause anxiety, for sure, so do you think maybe you started to panic and that made it worse?
What happens if you masturbate standing up, like in the shower? Or at a different time of day?
If this starts to happen, try calming yourself by focusing on other things. There's a method called the 5-4-3-2-1 method -
5 - Name 5 things you can see
4 - Name 4 things you can feel
3 - Name 3 things you can hear
2 - Name 2 things you can smell
1 - Name 1 thing you can taste
Of course, if this isn't working, and you are still having a very hard time breathing, call your local emergency number. This is a method that can help you calm yourself during anxiety, and I only suggest it in case you are getting anxious over heavy breathing.
If you are experiencing shortness of breath at any other time, definitely see your doctor to make sure everything is okay.