It's the screensaver timeout that controls this. AFAIK you can't set this to a separate time from the screensaver, but you can disable the function altogether. There's a checkbox right under the screensaver selection box, I forget the exact text of it, but if you uncheck it then it won't ask you to log back in every time.
I would like to know how to lengthen the period of inactivity before XP defaults to the welcome screen and makes me enter my password again to go back into my program. I have tried handling this issue through my Local Security Policy settings but have had no luck in resolving the problem. This is probably simpler than I am making it. Any ideas?