When using your phone, it’s generally a good idea to make sure that it is set to automatically lock. The exact amount of time you want your phone to wait before locking is a personal preference. When out in public, having a short auto-lock timer reduces the chance that your phone is unlocked if it is stolen or lost. When in private, having an auto-lock timer can help protect your battery life by locking the screen if you leave your phone alone for too long. This guide will walk you through the process of enabling an auto-lock timer.
The auto-lock settings can be found in the Settings app. The setting is located in Settings > Display & Brightness > Auto-Lock. Here you can choose to set your phone to automatically lock between thirty seconds and five minutes after the last interaction. It is also possible to configure the phone to never lock automatically, although this is not recommended.

Tip: Even with an auto-lock timer set, your phone will not lock automatically if a video is playing or a game is open. These functions will keep the screen on until either you turn the phone off or it runs out of battery. Lock your phone manually if you want it locked while playing a game, for example.
Did this help? Let us know!