The Navy’s nuclear-powered submarines can stay submerged for long periods of time. Air isn’t a problem as their make their own oxygen and keep the air clean. The limits on how long they can stay underwater are food and supplies. Submarines generally stock a 90-day supply of food, so they can spend three months underwater.
The diesel-powered submarines (not now used by the United States Navy) had a limit of several days submerged. They couldn’t run the air-breathing engines while fully submerged and had to rely on battery power and electric motors when underwater. They would have to surface and use the snorkel mast for air for the diesel engines to recharge the batteries and exchange fresh air.
