How to explicitly password-lock an iPhone regardless of timeout setting?
Solution 1:
There are 2 types of locking mechanism (certainly in iOS 5 and iOS 4.2.1).
Firstly, in Settings > General there is Auto-Lock, with settings of 1-5 minutes, or Never.
Secondly, same place, there is Passcode Lock, which if set has options of Immediately, after 1, 5, 15 minutes, or 1, 4 hours.
The first of these locks your screen after a period of inactivity (for the purposes of saving battery hence the max of 5 minutes), but the second refers to the amount of time that must pass after the screen it locked before the passcode is required to unlock (for the purpose of security).
A common mistake it to confuse the two, and the wonder why it does (or doesn't) ask for your passcode each time. You might have the auto-lock set to 5 minutes, thinking it is the correct setting, leaving the passcode lock to immediate which is the default. This is why you might need to re-enter your pin even if you try it only seconds after locking when you think it's set to 5 minutes.
To go back to the original question, without your passcode lock being set to immediate, there is no way to immediately lock your phone without waiting for whatever setting you have got instead. It would be nice if something like a double tap on the power button when locking did it, or if holding it down to get the slide to power off screen also had a slide to lock now section, and I may well head over to Apple feedback now to suggest same, but to answer the OP question directly and finally, the answer is no.
Solution 2:
You cannot explicitly lock the iPhone. The closest you could come is manually turn on the passcode each time you want to lock it, but obviously that's a bit of a pain. There may be a jailbroken app that does this, but on a standard iOS install, locking is solely based on the timeout with no way to explicitly lock the device.
Solution 3:
It's not exactly convenient, but if you have Require Password set for one hour, but power off the iPhone then power it back on, it will require your password even if you've entered it in the last hour.
Solution 4:
Probably not exactly what you're looking for, but worth knowing anyway. If you log into iCloud, you can go to "Find my iPhone", then after the phone is located, you can click the info icon and you have the option to lock your phone (provided you've turned on Find my iPhone and it's connected to the internet).
Solution 5:
On IOS 13, with the iPhone X and later, this is easy -
- press and hold the VOLUME DOWN and the POWER buttons simultaneously for two seconds
You will feel the phone vibrate momentarily (this is true even if you have system haptics turned off), and then be presented with the SOS screen.
Even if you now press Cancel, your phone will require require your passcode before re-enabling face ID.