From a search of the XP help-file using the phrase "automatically lock":
To protect your files by using a screen saver password
Open Display in Control Panel.
On the Screen Saver tab under Screen saver, click a screen saver.
Select the On resume, password protect check box.
If Fast User Switching is turned on, select the On resume, display Welcome screen check box.
Notes
To open Display, click Start, point to Settings, click Control Panel, and then double-click Display.
Selecting the On Resume, password protect check box will lock your computer when the screen saver is activated. When you begin working again you will be prompted to type your password to unlock it.
Your screen saver password is the same as your logon password. If you do not use a password to log on, you cannot set a screen saver password.
Fast User Switching is only available for stand-alone computers and users in a workgroup. It is not available if your computer is part of a network domain.
ZV