For security, you can set a passcode that you must enter each time you turn on or wake up iPhone, or when you access the passcode lock settings.
Setting a passcode turns on data protection, which uses your passcode as the key for encrypting mail messages and attachments stored on iPhone. (Some apps available from the App Store may also use data protection.) A notice at the bottom of the Passcode Lock screen in Settings shows that data protection is enabled.
Important: On an iPhone 3GS that didn’t ship with iOS 4 or later, you must also restore iOS software to enable data protection. See Updating and restoring iPhone software.
Set a passcode: Go to Settings > General > Passcode Lock, then tap Turn Passcode On and enter a 4-digit passcode.
Use a more secure passcode: To increase security, turn off Simple Passcode and use a longer passcode with a combination of numbers, letters, punctuation, and special characters.
To unlock iPhone when it’s protected by a combination passcode, you enter the passcode using the keyboard. If you prefer to unlock iPhone using the numeric keypad, you can set up a longer passcode using numbers only.
Prevent access to Siri when iPhone is locked: Go to Settings > General > Passcode Lock, then turn Siri off.
Prevent voice dialing when iPhone is locked: Go to Settings > General > Passcode Lock, then turn Voice Dial off. (Available only when Siri is turned off in Settings > General > Siri.)
See Passcode Lock.