The male sexual organ is a muscle and when you exercise it, results in fatigue, just like the others muscles of the body.
In the case of the genital organ there is a big accumulation of blood in your tissues, responsible of the erection.
Therefore, in the case of a prolonged erection, the big blood flow won’t stop, resulting in pain.
If until after the erection the pain persists, the best to do is to have attention and go for a doctor.
But generally, is normal, mainly between young and teenagers, to feel pain after a prolonged erection.