Is there a quick way to lock my Mac?
Does OS X have the option to allow you to lock your screen?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Yes set System Preferences->Security->General to require password after screen saver begins
And in System Preferences->Desktop & Screen Saver->Screen Saver hit the hot corners button and choose one or more of the corners to Start Screen Saver
There are also Dashboard Widgets to help here. I have not used any recently.e.g. a widget to lock and others to send the mac to sleep.
In addition to screen saver and sleep lock (see Mark's answer), you can also enable fast user switching and use the menu to go to the login window without logging out. You can also do this through the command line without enabling fast user switching:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
There's a project called Dockables that is nice: http://getdockables.com/
It's a collection of apps for key system events, like log out, lock screen, sleep display, etc... I have the "lock screen" installed and use it a lot. I don't keep it in the dock, but I call it using spotlight.
Alfred App allows you to issue system commands including 'Lock' & 'Sleep'. That's what kept me using it.