You can set your Mac to automatically require your password after sleep or screen saver mode begins. The time periods range from immediately to 8 hours. This feature can help you increase your mac's privacy and safety.
How to change the time limit for a required password
Click the Apple in the menu bar
Click System Preferences
Click Security & Privacy
Within the Require password "___" after sleep or screen saver begins, change the time limit in the drop-down menu to whatever period of time you want your Mac to require a password
You'll be prompted to enter your password after selecting a time frame