Even with the described security measures in place, they can be of little value if anyone can sit at your unattended Mac and begin working under your logged-in account. Mac OS X includes several features to prevent such unwanted access.
Log Out on Idle
The Security Preferences pane contains a checkbox that enables automatic logout after a specified period of inactivity, from 5 minutes to 16 hours. The behavior of this logout is identical to that of a manual logout, prompting you to save any unsaved documents (the logout stops if you don’t answer the prompt).
Also on the Security Preferences pane is a checkbox to enable screen-locking upon wake from sleep or the screensaver. When enabled, this feature presents an authentication dialog box that prevents display of the desktop until you supply the username and password of any admin user. The dialog box also contains a Switch User button that, when clicked, presents the Login window, allowing other users to log in without disturbing the locked-out account.