If your PC always boots to the desktop ok, and all works well, then crashes after several minutes, it does point to heat problems. If you built it yourself, did you put some thermal paste on the top surface of the CPU, before you put the heatsink on?
If no, you only need to use about 5mm diameter, 0.5mm thick, right in the middle of the CPU. The heatsink will squash it out when you clip it on. You should not be able to see any afterwards looking at all four sides, when heatsink is on.
Also is the fan working on top of the CPU? If possible can you try some different RAM ? Or at least take out what you have now, and refit again.