Require Password After Sleep
After you set up a login password, it's a good idea to enable a couple other settings while you're in that same window.
Place a checkmark next to Require password and then in the drop-down menu, select Immediately if it isn't already.
This setting will lock down your Mac whenever the screen saver is activated or your Mac goes into sleep mode. When it's disabled, anyone can access your computer after the screensaver comes on or when your Mac goes into sleep mode, even if you have a login password enabled.