The first guy has a point. If your CPU overheats, it will shut down the computer automatically to protect itself. There are free utilities that show you the temperature of all 4 cores in your processor. There are 'stress test' programs that work all 4 cores at top speed and you can track their temperature. If this is your problem, you might only need to replace the thermal paste between the CPU and the cooler heat sink.
Another thing to try is to reinstall Windows. This is a hassle because you also have to reinstall all your applications programs and set everything up. But it's just possible that there's some malware in there somewhere that's overworking your CPU or causing shutdown as a 'side effect'.
You could do an 'idle test'. Assuming you're using Windows 10, shut down all your programs until it's just Windows running. Then hit ctrl-alt-delete and look at the Task Manager. Hit 'more details' if necessary to see the five columns--CPU, Disk, Network, Memory, Power Usage (not in that order necessarily. I'm going from memory here). CPU and Disk usage should quickly decrease to very near zero. Look at the list of tasks running--there may be a dozen or two even when the computer is 'idling'. See if they all have readable names. If you have any whose names are just random characters, that's probably a virus or something.
It COULD be the motherboard, but that's really very unlikely. Gigabyte is a pretty good brand.