sleep mode can be set to need a password but is bugged in windows 7 and never worked well... in windows 8 or 8.1 you have the "lock screen" with extra options and that works very well.
Note however; any hacker worth spit will get around this screen if they can sit at the computer, it's use is for locking the screen from people remoting in from over a network.