If you use Windows XP or below, right-click on Desktop > Properties > Screen Saver > Power and set Turn off hard disks, System standby and System hibernates to Never.
If you use Windows Vista or above, go to Start > Control Panel > Power Options > Change plan settings and set the Turn off the display and Put the computer to sleep to Never.