My diesel submarine could sail from the port and safely navigate sea with 25% of the crew for a limited period of time, in case of an emergency like a hurricane. (naval ships can ride out some hurricanes in port, but are always safer at sea). The endurance was limited by the ability of the crewmembers to get sleep.
The limiting constraint on operating in a war-fighting or patrol capacity is to have enough crew to man battle stations and damage control in case of a casualty.
For battle stations, 100% of the crew is awake, and all stations with the exception administrative and supply are manned. Anyone not manning a station is in the galley, on my sub, constituting a damage control team and relief for the crew on battle stations.
For patrol duties, where the submarine is effectively on a war footing, the limiting constraint is to have enough qualified watchstanders to fill the 24-hour rotation.
The CON has the most number of crew members on a watch. On my Korean era diesel sub, we had 3 planesmen, 1 Chief of the Watch, 1 Officer of the Deck, 1 Control Officer, and 1 Quartermaster. The planesmen manned two stations and the third ran coffee and errands for the COW, CON, and OOD, and relieved the other two planesmen. The CON and OOD can be stood by one officer in a pinch.
Typically planesmen are formed from the seaman gang, a group of non-rated sailors attached to the Weapons Department. They handle lines when the boat comes in and out of port, form damage control teams, and help out the cooks when the ship is underway.
The Engineering Depart was the second most populace station with 1 Engineering Watch Officer, 2 Engineering watchstanders, 1 Engineman, and 1 Rover. In a pinch, the EWO can be one of the Engineering Watchstanders.
For stations like Radio and the Torpedo Room, the minimum number of watchstanders for any station is 2 -- one awake and one asleep, or at least, not on watch, every six hours (for US submarines)
Some stations like Sonar require multiple watch standers rotating through manning the equipment for brief periods of time since they couldn't concentrate on interpreting sounds and tracking targets for the entire watch period. So a minimum crew for a Sonar department would be 4 -- two per watch.
For at sea operations, only the store keep was important from the administrative departments.
The Galley had 2 cooks and 3 food-cranks helping prepare and serve food. Both cooks and cranks could go down to 1 stander each.
My submarine had a complement of 90. We could sail under duress and stay away from the port with 25 people for a few days. For a typical patrol, we could function with 60 crew members -- we had a 2-month endurance that could be extended to 90 days by stacking food cans on the floor of berthing. Our limiting constraint was water since diesel subs have limited capacity to distill seawater into potable water. We only took showers once a week, and then they got wet, turn off the water, lather, rinse, no repeat. And, didn't do laundry.