There is an option to lock the system when the screensaver is activated.  Control Panel > Display > Screensavers tab for XP, or Control Panel > Appearance > Personalization > Change Screensaver in Vista.
So is there any software out there that will auto lock my computer after so long ?
Software That Will Lock My Computer