At present, many important vessels in the United States Navy are powered by nuclear reactors. All submarines and aircraft carriers are nuclear-powered.
Before nuclear power, submarines were limited to rechargeable batteries, which did have an advantage of quiet but a very limited underwater recharge cycle (about a day at cruising speed) but more so their range was very limited. Nuclear power in a submarine allows the boat to stay submerged as long as the food lasts onboard. This is valuable for stealth since a submarine can leave a US port, go poke around next to any countries shores then come back while never breaking the surface of the water. They do not surface to fire missiles – the missiles are fired underwater. The submarines could stay under for more than three months, but they run out of food. It is true that diesel-electric can be quieter but it doesn’t have the endurance even with the newest AIP systems. The other point is logistics. Surface ships can UNREP (underway replenishment) Submarines don’t UNREP.
For the surface ships but the aircraft carriers, the main reason is the cost and the need for more space.
The US had several nuclear cruisers (Bainbridge, California, Long Beach, Truxtun, South Carolina, Virginia, Texas, Mississippi, and Arkansas). They were retired, often after quite short service lives, and replaced with conventionally powered cruisers (the Ticonderoga-class). The reactor plant itself was expensive to build and to refuel, and the crew of nuclear-trained watchkeepers even more so. The California needed a crew of nearly 600, much of it driven by the reactor plant; the Ticonderoga’s, with similar weapons and capabilities but gas-turbine propulsion, had a crew of only 330.
The other point is space. Because of the reactor compartment and the associated subsystems would take up significant room. It will make warships bigger, will be limited to find a convenient port to berth around the world.
Although nuclear power gave a long endurance in theory, in practice the nuclear-powered warships were still limited by the need to replenish food (and with a larger crew they need more provision), so the notion of a nuclear carrier and her nuclear-powered escorts racing about at thirty knots unhindered is a not easy to conduct. The carrier, too, needs to regularly replenish food, jet fuel and especially ordnance.
Nuclear power for carriers is similarly a marginal benefit in many ways, but a big advantage is the supply of steam for the catapults (or electricity for EMALS) hence why the US continues to build CVNs.
So, the nuclear-powered warships were more expensive to build and crew and offered no clear advantage over conventional propulsion. On the other hand, gas turbine gives much greater maneuverability and sprint capability for a surface ship.
Hence the nuclear powered cruisers were retired and their replacement uses gas turbines or diesel engines.