It depends is the answer…the answers below are sound. My experience is with Pressurized Water Reactors (PWR), and boiling water reactors for commercial and Naval nuclear power. For a shutdown (S/D) initiated by a rapid insertion of the neutron absorbing control rods (mostly Hafnium), 5 seconds is a good answer. A controlled shutdown for planned maintenace activities varies, based upon the time in core life, and when restart is expected, but 6–12 hours is pretty bounding.
By shutdown, I’m assuming you meant the critical chain reaction that was ocurring within the reactor core. Decay heat, which is generated long after the reactor is sub-critical and shutdown, is another story. Decay heat, produced by transuranic and radioactive elements produced in the fission process is significant. Very significant. You cant just “walk away” from a shutdown reactor after power operation is terminated. For most of the very few reactor accidents that have ocurred worldwide, you may be faimilar with, post S/D decay heat was responsible for the damage done to the reactor after it was S/D.
Only one such occurrence of note has happened in the US commercial power industry, and that was the now ”infamous” Three Mile Island (TMI) accident. Reactors are designed with redundant, robust, highly monitored and tested trains capable of removing decay heat. By circulating water through the reactor after S/D, which is how they are cooled post non-accident shutdown as well.
A series of synchronous, redundant events, including human error ocurred which essentially stopped the cooling systems from providing the necessary cooling to the reactor. The same is true for the Fukushima accident in Japan. The vast majority of the Nuclear damage done, was by an inability to cool the reactors post S/D, in an extreme, rare post Tsunami disaster scenario.
These redundant cooling systems require electrical power, though some reactors can receive cooling through the controlled release of steam, eventually, the coolant water will need replenishment. Nuclear stations have robust and redundant electrical supply systems, including self-power ones through on-site, permanent emergency diesel generators. As you can imagine, the havoc wreaked on the Fukushima site by the Tsunami obliterated the electrical infrastructure. The TMI accident/loss of shutdown cooling was not due to loss of electrical power.
As an industry, nuclear power has a proven track record of nuclear and radiological safety. Lessons learned were shared among all owners of nuclear plants in the US, and have been effectively implemented years ago, monitored routinely by the operators of the plant, the NRC, and external oversight agencies. Additionally, lessons learned from Fukushima have been and are being agressively implemented by the US commercial power industry, going well beyond the design bases accidents the plants were designed and licensed to.