It's always a VERY good idea to lock your Mac screen when you walk away even for a minute or two. There are probably files and data you would rather the whole world not be able to access!
A simple way to protect your files when you walk away from your computer is to hit Shift-Command-Option-Q to do a fast logout of your user. Your Mac will go back to the login screen. However, there’s a huge downside to this method—all of your currently-open documents will close, and any running applications will quit prior to the logout.
A relatively quick method of locking your Mac—while still leaving your programs running—is to activate the screen saver using a hot corner . To do this, open the Desktop & Screen Saver System Preferences panel (by clicking the apple in the upper left) , activate the Screen Saver tab, and click the Hot Corners button. Decide which corner of your screen you’d like to use, then click the corresponding pop-up menu and select Start Screen Saver. Now when it’s time to walk away, just fling your mouse into that corner of the screen, and you’ll trigger the screen saver.