Per-app password in iOS 5.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.