It's possible that your PC may be overheating. Play with the side panel off. If the PC does not lock up then it is definitely an overheating issue. You'll need to clean out any dust especially on the fans and CPU/GPU heatsinks. Adding in another fan is also a good idea if possible.
If it still locks up your graphics drivers may have been corrupted. Un-install them, then re-install the same drivers or new drivers.