In the OS X Security system preferences you can set the system to require a password when the system wakes from sleep or after the screensaver has been active for a period of time. However, you may run into a few cases in which entering your account password then does not work.
One cause can be if you have recently changed the name of your user account. For authentication, OS X will use either the short or long username, along with any aliases that you have associated with your account. However, if you have changed the long username for your … Read more