When you first set up a new Mac, or when you do a clean installation of a new version of OS X, you create a user account, and that account is set, by default, to log in automatically at startup. This isn’t a problem when you’re at home, but if you use a laptop, and travel, this is a serious risk. This automatic login means that anyone who finds your Mac only needs to start it up to have access to your files.
You can change this, and tell OS X to display a login screen on boot. There are two ways to do this.
First, if you go to the Users & Groups pane of System Preferences, and click on Login Options, you’ll see a menu that lets you choose which user logs in automatically at startup, or you can choose Off from this menu to turn off automatic login.