Before you spend money on something you may not need nor will fix the problem try a little test. Take the side off the PC, point a household fan at the inside and then do some gaming. If your PC is stable its the temperature. If it restarts you'll know that's not the issue.
Its always best to try to do as much free debugging as you can before spending money. Been there, done that!