To enable an automatic lock on your user profile when the screen saver resumes:
Control Panel
Display
Screen Saver.
A screen saver will need to be in use for this purpose, if none are being used then select one from the drop down list.
Put a tick next to "On resume, password protect".
Choose the time before the screen saver activates when the pc is not being used.