Is it a good idea to shut down or put to sleep my PC seconds after
some very heavy processing load on the CPU or GPU?
It is neither a bad idea or a good idea. A PC is designed to be turned off, put to sleep, and to be left on. It being used at 100% load or 0% load makes no difference, it is designed to be used, any failures will not be linked to the type of work it does.
I'm asking this because i'm not sure if the cooling system has enough
time to cool the components down to an acceptable temperature before
the shut down; that would mean that the components might even be
damaged or have their lifespan significantly reduced due to
insufficient cooling.
If electricity is being ran through a circuit, and the temperature of the corespondents are within their specification, then having no electricity and the temperature still being within the specifications makes no difference. Your PC will cool itself off faster, without being turned on, for obvious reasons. I have left my last 4 computers, spanning over 20 years, turned on 24/7/365.
If the system is cooled enough to keep the system stable for 12 hours a day then its stable enough to be ran 24/7/365.
Should i worry about this or does the hardware is smart enough not to
shut down the cooling before it reaches an acceptable temperature?
There is nothing to worry about. The cooling system in a general sense does not care if the system is at 100% load or 50% load it will continue to cool the system no matter what.
You do understand, the hardware is not smart enough to do anything it was not designed to do, right?
1I vote to let it cool down before shutdown. – Moab – 2015-12-29T19:16:44.140
Why would you think a faster change in temperature would be better than a slower one? That seems backwards to me. – David Schwartz – 2015-12-31T17:00:48.117
@DavidSchwartz: Isn't this what coolers already do? – Gabriel S. – 2016-01-02T18:54:15.527
@GabrielS. Not really. Because while a good cooler will cool the CPU faster, it will also cool it from a temperature that's not so high. But a smart cooler that can adjust fan speed to both keep the peak temperature as low as possible and avoid cooling the CPU too rapidly is best. But the most important factor for both CPU life and performance is keeping the peak temperature as low as possible. – David Schwartz – 2016-01-02T19:13:59.450
1There is a temperature range in which the chip will operate properly. When powered off, you aren't worried about operation. Temperatures that can physically damage a powered off chip are much higher. The heat comes from the electrical operation of the chip. You're removing that heat as it's produced. When you remove power, you aren't adding any new heat, and the silicon wafer inside can't get hotter than it was when powered. – fixer1234 – 2017-01-16T21:25:55.140