This depends on so many things. I can stay hard for quite awhile not touching my cock or having my partner touch it if I am stimulated other ways such as kissing or my nips being bitten, or sucking on various anatomical parts of a partner. All of this is stimulation of a sort, though, even if no one is touching my cock. In that situation, I tend to stay pretty hard. With no stimulation at all, I typically get soft relatively quickly. If I'm watching porn and haven't cum, then I stay hard awhile, too UNTIL I actually touch myself. Once I've done that, the erection subsides some when I stop.
I found that the much more important question is not how long I can stay hard, but can I get hard again. I used to worry about losing my erection during sex, but when I learned that they come and go, and I can usually get hard again pretty easily, then I relaxed and learned to enjoy things more.