Per-app password in iOS 5.1

Solution 1:

No, there is no way to do this on iOS 5.1 or on any earlier version of iOS.

It's doubtful that Apple will add this feature, given their usual proclivity toward not including features that could be difficult to configure and support, particularly on iOS.

This of course means that each app developer can implement their own passcode locking mechanism. It's just not an API that Apple provides to developers to ask again for the same passcode before it operates as opposed to locking the entire device.

Solution 2:

Apple view these devices as personal so there are no multiuser features. But mail in particular is useful to lock in case you hand your phone over to someone to show some photos, even just for a few minutes. Some people suggest just turning off mail in settings but that doesn't remove cached mail and isn't secure. There is an app called Better Webmail that might meet your needs: PIN locking, supports Yahoo and Gmail etc.