To lock windows 7 after inactivity for certain amount of time, follow the steps provided in this tutorial.
Steps to lock windows 7 after inactivity
1. Step Click on the Start >> Control Panel.
2. Step Click on the ‘System and Security’ link.
3. Step Click on the ‘Power Options’
4. Step Click on the Change when the computer sleeps at the left side.
5. Step Now, in the Edit Plan Settings, select the time in ‘Put the computer to sleep’ and click on the Save changes. In my case, i have selected 5 minutes. That means, if i leave my system idle for 5 minutes, the computer will automatically go to sleep.
It will definately be more secured if you lock or make your computer go to sleep when you leave your system idle for more than certain amount of time so in your absense no other person can use your system.