Control Panel > Display Properties > Screen Saver tab > remove the
checkmark from 'On resume, display Welcome screen'
You're not being logged out...you're just being returned to the Welcome
screen, where you'll need to enter your password to return to your desktop.
It's a handy security feature for when you're away from your desktop
while the screen saver is running. Otherwise, anyone can touch a key on
your keyboard of nudge your mouse and use your computer.