What do you mean?
Your device autolocks itself very quickly? Check Settings>Display&Brightness> AutoLock .. adjust the time.
Your screen goes black and the iphone is frozen?
If your iPhone, iPad, or iPod touch won't turn on or is frozen - Apple Support
Regards
Giulio