Locking your screen prevents others from using your Mac. To stay logged in to your Mac while you are away, you need to lock the screen. When you return, type your login name and password to continue working.
- Open System Preferences, and then click Security.
- Select "Require password to wake this computer from sleep or screen saver."

A person with an administrator account can use their name and password to unlock the screen.
Locking the screen does not prevent other users from turning off the computer and restarting it, then logging in to their own account. If you think this could happen, be sure to save your work before you leave your computer.
