Hmmm... not sure, but my guess is you just got too vigorous with your penis & it's irritated & like any other tissue, that could cause temporary swelling. I would not masturbate or stimulate it in any way for a few days & see if the swelling goes down. If after 2-3 days it's still swollen, you should see a Dr. Please do NOT be embarrassed to tell him/her what happened - believe me, they know all about masturbation, they know it's extremely common & quite normal. You need to tell them exactly what happened, don't try to hide it, otherwise they probably won't be able to help you.
I think you should still wait a cpl days & see what happens, don’t masturbate or stimulate it in any way, give it a chance to heal. If it’s not better in 2-3 days, definitely see a Dr...