Update your post to include full system hardware specs and OS information.
Include PSU: make, model, wattage, age, condition (original to build, new, refurbished, used)?
Disk drives: make, model, capacity, how full?
= = = =
The shutdowns may not be directly related to temperatures.
Pending suggestions regarding required temperature logging software, take a look in Reliability History and Event Viewer.
Either one or both may be capturing some error codes, warnings, or even informational events that occur just before or at the time of the shutdowns.
Start with Reliability History. Much more user friendly and the time line format can be helpful with spotting trends and patterns.
Event Viewer is not as easy to navigate and follow but take a look around. No rush - you will probably get the sense of it all after a bit of trial and error.
And if the computer is not shutting down then you will still end up with a baseline understanding of your computer's performance and history when all is well. That too, in turn, will help you spot some future problem(s).