Macintosh has no obvious solution to the problem of wanting to lock your system. Macworld had a neat article discussing the topic here, but I did not really find any of their suggestions particularly helpful or useful. However, the one that I now use and found most practical and helpful was from the comments.
If you activate Fast User Switching, you can bring up the login window without closing any applications or documents. To activate it, go to System Preferences -> Accounts and then to Login Options at the bottom of the left pane. Check the "Enable fast user switching" box and you are set to go! The Accounts icon will appear at your top menu bar (or user name, depending on the setting you choose). You can move it around to your liking as explained here.
Just click on that icon (or text) and choose "Login Window" and (assuming the account has a password assigned) your system is locked!