Could be hardware. Could be software.
Is it the same program everytime causing the issue? When does it happen? e.g. on closing a program, on shut down etc.
Basic check list:
- Re-seat RAM
- Re-seat graphics card
- Check the inside of the case for dust build up (not a normal symptom of heat, but always worth checking)
- Check CPU, HDD, and motherboard temps (use Speccy or CPUID to check from within Windows).
- Run virus and malware scans
- Check what is running in task manager
- Update all drivers (chipset, GPU, sound etc)
- Boot into safe mode with networking and see if the problem occurs during normal usage
More advanced checks:
- Test RAM with Memtest86
- Test hard disk(s) with manufacturer's diagnostic tools or SeaTools
- Perform a repair install or resintall (after doing a back up)
- Stress test the CPU using Prime95
- Stress test the GPU using FurMark or a game's own benchmark tool