There are all sorts of processes which kick in when your CPU is idle, from Windows Update (Vista), to other application updaters, to viruses and trojans which try to mask their activity by kicking in during idle times when you are less likely to notice.
Any of these could be the problem. Quite famously, many virii/trojans which try to use an internet connection but cannot for one reason or another (firewall; internet disconnected) will hang because they were not designed to deal gracefully with that situation.
Have you looked in the Event Viewer logs for any indication as to where the problem may lie? Click Start and type 'eventvwr' in the Run box.