If system shut down automatically, then this problem could cause by CPU over-heating.
Try go to BIOS menu by press [Delete] key when system boot up.
Then check CPU temperature is under or arround 50 degrees.
If CPU temperature is over 50 degress and going up, then this could be CPU over-heat problem.
For AMD model, try to check CPU fan locked properly to the CPU bracket.
Apply some thermal grease on the CPU die surface and use copper base CPU heatsink can reduce the chance for CPU over-heat.
For Intel model, try to check CPU fan locked properly to the 4 secure holes.
Try to refer user manual from Intel CPU for proper CPU fan installation process.
After proper CPU fan installation and apply thermal grease, system should running fine and boot up to OS.
If there is any problem, please contact local dealer or local shop for system check up.
Maybe there is something wrong with your installation.