"My Mac is now updated" (?) Updated system? New Mac?
Or, have you just reinstalled 10.8.5, and still on that system?
So, if you sleep your Mac, maybe for more than an hour, then wake it up, sometimes it asks for password, and sometimes just immediately returns to desktop?
And, same thing happens when you shut down (not sleep)?
If you are still on Mountain Lion:
If you want to always enter password, re-check your settings:
Security & Privacy pane:
Make sure that "Disable automatic login" is checked, and "Require password immediately after sleep or screensaver is set.
You must unlock that pane to make changes.
Do you also have File Vault turned on?
As you may know, if you are using File Vault, that will ask you for password to unlock the boot drive, then ask for your password again at the login window - that absolutely will disable automatic login, as File Vault won't allow that auto login. ( I am not suggesting that you use File Vault -- only that File Vault will directly affect your security settings.)