Automatically lock your screen
When you leave your computer, you shouldto prevent other people from using your desktop and accessing your files. You will still be logged in and all your applications will keep running, but you will have to enter your password to use your computer again. You can lock the screen manually, but you can also have the screen lock automatically.
Click the icon at the very right of the menu bar and select System Settings.
Select Brightness and Lock.
Make sure Lock is switched on, then select a timeout from the drop-down list below. The screen will automatically lock after you have been inactive for this long. You can also select Screen turns off to lock the screen after the screen is automatically turned off, controlled with the Turn screen off when inactive for drop-down list above.
To lock your screen immediately, click the icon at the very right of the menu bar and select Lock Screen, or just press Ctrl+Alt+L.