There can be many reasons for locking up of the system... ranging from hardware problem to a software issue.
If it's a hardware problem, it could be locking up due to overheating, etc.
In case of software issue, there might be a startup program that might be causing the lock up. So, you will have to take a look at the list of startup programs, and identify the one giving problem. There can be other such reasons. You can find a list here:
http://h10025.www1.hp.com/ewfrf/wc/d...name=c00820174
If you aren't able to solve it by yourself, it's better to take it to a computer shop for diagnose and repair, because it will require taking a detailed look at different things to see what's causing it.