EDIT:
ugh. mad jew beat me to it. 🙁
but yeah, that's how you do it. 🙂
oh and to lock it right away you can spotlight keychain access and in those prefs put show in menu bar, then you can click lock screen instantly, requiring a password
and, next time post in mac basics and help. 🙂