Microsoft and Apple both provide built-in screen savers with locking capability. To enable the screen saver and turn on the locking feature, follow the directions below for your specific operating system.
Unless you're in a private office, you should configure your computer to run a screen saver that will automatically lock your screen after a short period of inactivity and require a password to unlock it. This will prevent unauthorized individuals from viewing your private information or exploiting access to your computer in your absence.
Windows 8.1, Windows 8, Windows 7
Mac OS X
Click Screen Saver and then use the slider to choose 15 minutes
Optionally, set up a hot corner to let you invoke the screen saver manually:
Click the Hot Corners button
Click the list next to the corner of the screen you want to use as a hot corner and select "Start Screen Saver," and then click OK.
Manually Invoking the Screen Saver
On Windows, you can manually invoke the screen saver (thereby locking your computer) any time you leave your work area by pressing the Windows logo key (near the spacebar) and typing 'L'.
On the Mac, you can invoke the screen saver manually by moving the mouse to the hot corner you set up for that purpose (see instructions above).