How do I change the amount of time it takes for my iPhone to sleep/lock?

My iPhone locks too quickly or takes too long to lock, how do I change the amount of time it takes?

Your iPhone has a setting that dictates how long of a period of inactivity it takes for the display to go dark and the phone to enter lock mode, requiring you to unlock it to get back in. It can be annoying if you have something on your screen you are looking at for reference and it goes to sleep on you. Alternatively, if it stays on too long it wastes battery. You can easily change this by heading to Settings -> Display & Brightness -> Auto-Lock. Choose 30 seconds, 1 - 5 minutes or never.

How to change the time it takes for your iPhone to sleep/lock.