Question After gaming for a couple hours my computer will shut off

Mar 8, 2019
20
0
10
Recently i got a new gpu :XFX Radeon RX 580 GTS XXX Edition 1386MHz OC+, 8GB GDDR5. so i put the settings up on some of games i play apex legends and path of exile and after gaming for over 2 hrs at least my computer will shut off completely. my cpu is a amd fx 8350 eight core. i want to determine if the problem is from overheating and which component is causing overheating and if getting a water cooler would fix the problem. i havent overclocked anything. i have 4 fans on the case the gpu fan is the stock one but the cpu one is a: "be quiet! BK009 Pure Rock - CPU Cooler"is that fan not strong enough? sorry for the long post first time i have done this.

I am in a cold room right now because its winter. idle the gpu temp is 41C and the cpu is 18C. i would like to find out whats causing my computer shutting off safely and fix it. every time it shuts off im scared to see a blue screen the next time it turns on.
 
Mar 8, 2019
20
0
10
my bad if i sound dumb but how do you check your temps when the computer shuts off if u dont know when its going to shut off. and what do you mean by check your memory?
 
Mar 8, 2019
20
0
10
Critical 3/11/2019 6:27:49 PM Kernel-Power 41 (63)

this is what my event viewer said for the crash does it mean its not the overheating?

like i dont understand how it can be a power supply problem? this crash today was after the computer was on for over 9 hours gaming for 4 hours straight a little break and another 5 hours