You had a male orgasm. After you have an orgasm your penis returns to its normal state "soft". The penis wont stay hard forever, when sexually stimulated the penis arteries relax letting more blood flow into the penis (arteries bring blood to penis from heart) . At the same time the veins in the penis tighten (veins carry blood away from the penis to the lungs to be oxygenated). With the flow of blood in the penis increasing and the flow of the blood out of the penis decreasing this causes the pressure in your penis making it "hard". When you are done being stimulated or reach orgasm (cumming) your veins open up to let blood out of the penis making the pressure inside your penis go back to normal leaving it flacid or "soft". Youll be okay don't worry! It's perfectly normal. If your worried about this because after your partner orgasm's she is still able to keep going on with intercourse like a little energizer bunny, it is perfectly normal the female body is built very different. Masturbating more and more sexual activity will help you sustain longer periods of intercourse before cumming.