Custom Computer shuts down randomly (specs inside)

it can be all of those. you need to start stress testing hte system.

test ram first with Memtest86+. burn to a disk or flash drive and run from the boot menu. Run for 11 passes or more.

test the CPU next with Both Prime 95 and Intel Burn Test. just not at the same time! Run prime 95 for 5 hours then Intel Burn Test set to maximum memory and for 40 runs. Watch CPU temps while testing as it will get hot.

test the GPU next with OCCT on GPU test with error check enabled.

If anyone of these error this will be where the issue will lay. Whether it be a bad bios setting or a faulty part, this will tell you where to start looking.

EDIT: the time you put into the testing is the piece of mind that you get out of it. These will take hours to complete so do not rush it as you can miss a bad part or the cause of your issue if you do.