You go to Friends on the right side of the XMB, then select Add a Friend. In the "To" field, type the other persons PSN ID, type a message if you want, and click Send.
Alternatively, if it's someone you've met playing a game online you can just go to Recently Met. Then scroll to their ID, press X, and select Add as Friend underneath their ID box.
Anyway, hope that helps.
Last edited by Rodimus; 20th July 2011 at 11:20 PM.
Reason: Forgot something