We still don't know diddly about system specs. Age of system, store bought, or self build, make, model, CPU, RAM, HDD, PSU, motherboard, etc. We don't even know what OS is running.
In the absence of any of that info, I am maybe wondering about the RAM, and about overheating, but mainly about the HDD. Does it make a clicking sound? When was it last defragmented, if ever? feel HDD & see if it is hot. Check ide or sata cables for correct connections (with power off!)
Does it happen absolutely at random, or can you predict that it will always do it (say) 20-30 minutes after booting, or when the DVD drive spins up, or when the HDD clicks a lot, or when you open a new program?
I am also wondering about running out swap space, or a heavily fragmented swap file. Considering the initial query, it may be that some overdue maintenance attention is called for...
Where to start? Open the case with the power off and have a good clean, being careful not to damage anything?