How to set screen sleep time?

Set sleep time to lock the screen automatically.
1.Go to Settings > Always-on display & Lock screen > Sleep.
2.Choose an inactivity interval.
The screen locks if you do not wake up the phone in the interval.