Step 3: Setting the lock
From your home screen, select Settings, General, Passcode Lock, and then Turn Passcode On.
You will then need to type in a four-digit code. Like any secure "PIN" system, you need to make the number reasonably memorable, but not insanely obvious. Do not use "1234", "9999", "0000", "1098" etc. Instead, maybe use the last four digits of your mobile number, the day and month of a birthday, the year you got married etc.
Confirm the code, make sure it is set to be required "immediately", and you are sorted.