Windows XP
Click Start, click Control Panel, click Performance and Maintenance, and then click Power Options.

Then you can adjust the power settings for standby to NEVER and hibernates to NEVER if you want to be able to remotely connect to it.
-------------------------------------------------
Windows 7
Power Settings
To access power plan options, type power settings into the search bar in the Start Menu and hit Enter.

The Power Options screen opens and from here you can select from three predefined plans–Balanced, Power saver, or High performance.

Click on Choose what the power button does and you can tweak several options such as Requiring a password on wakeup and what the power button on the computer does. If you set When I press the power button to Do nothing, you won’t have a problem with the PC shutting down when you accidently hit the power button.

To change any one of the predefined power plans click on Change plan settings.

Then you can change the amount of inactive time before the monitor is turned off or the computer goes into Sleep mode. If you change the settings to Never for Sleep you will be able to remote connect to it.

If you want to revert back to the default settings, simply click on Restore default settings for this plan.