go to your desktop, and right click anywhere, then select properties and wait for the box to appear, then click the screen saver tab at the top of the box, and you should see:
"wait X minutes" and then " on resume, password protect" with a tick box next to it.
Make sure this tick box is unticked.
Because if the system is going to screensaver mode, and then requiring a password when you return, it will act as though you have logged out.
If it is not a screensaver -- check your power settings. Should you require additional assistance and guidance, Microsoft does have an official Windows 7 Support Forum located here http://tinyurl.com/9fhdl5 . It is supported by product specialists as well as engineers and support teams.