Settings, general, Restrictions. Turn on, enter pin of your choice. Choose what restrictions you want in place.
Its easy.
*Dons spam jacket*
NOT that easy. The passcode for the restrictions is the original passcode you set to get into your iphone. If you have changed the passcode to get into the phone, the restrictions passcode is still the original passcode you set. You can easily change the passcode to get into the phone, but the only way to change the restrictions passcode is to re-store the iphone to it's original settings - which wipes out all contacts, etc. My daugther knew my old passcode - which remained the restrictions passcode and if I wasn't really careful, she would get in and change the restrictions back. The Apple folks will back up 250 cantacts for you, but if you have more, they can't or won't do it. I had to back up to itunes, (they won't do that for you - so you have to go home and do that - then home back to the Apple office, reset the phone, re-set for a password to get in and another for the restrictions, then restore the contracts by synching/restoring from itunes). A bit of work, I thought.