1) Turn on "fast user switching" in System Preferences->Accounts->Login Options. Then select "Login Window..." from the Fast User Switching menu in the menu bar.
or
2) Turn on "Require password to wake this computer from sleep..." in System Preferences->Security, then put your computer to sleep (if you have a notebook, just close it).
or
3) Open "Keychain Access" from your Application/Utilities folder open the preferences and select "Show Status in Menu Bar" and select "Lock screen" from the keychain menu in the menu bar.