To create a passcode (password) lock on an iPhone there are a couple of steps. But if you read below this will be pretty easy.
Step 1 - Go to “Settings”.
Step 2 - Click “General”.
Step 3 - Scroll down and click on “Passcode Lock”.
Step 4 - Click “Turn Passcode On”
Step 5 - Type in a passcode of your choice
Step 6 - Under Require Passcode, specify how often you’d like to require a passcode. If you choose “Immediately”, your phone will lock every time you turn the display off. However, if you specify a time frame, your phone will only require a passcode after a certain amount of time has elapsed since the last use.