There is not a specific answer for how long the average person with a penis can stay erect. What matters is if you are unable to maintain an erection for a long enough time to have satisfying sexual intercourse.
There is also an alternative where the penis stays erect for too long, a condition known as priapism. If your erection exceeds 4 hours, you should seek emergency medical attention.