Well this may be caused for several reasons.
1. run the hard drive diagnostic utility mentioned by hamluis.
2. If the hard drive seems fine, the next simplest thing to do is to check the ram. If you download memtest86 and burn the iso file to a disc, it can tell you if your ram has any errors. http://memtest86.com/
. Have your computer boot off the disc, and it should automatically run. Let it run for a few hours, preferably overnight, and it will show you if it finds any errors.
3. A system locking up can be a sign of a failing motherboard. I know this may seem a little drastic, but I've seen it happen before, especially in some older Dell computers. A good way to check is to see if some of the capacitors are bulging on the motherboard. Here is an excellent report about it on wikipedia http://en.wikipedia.org/wiki/Capacitor_plague
. It will show you images of bad capacitors. Take a look around inside your computer and see if some of them are really bulging on top, or even leaking electrolytes.
"I think there is a world market for maybe five computers." - Thomas Watson, Chairman of IBM, 1943