WWII submarines making a journey of any length would run on diesels on the surface during the day, if there were reasonable odds of not being sighted. Rapid ("crash") diving was a very important tactic for them, and the ability to do it quickly was an important factor in both sub design and crew training.
If they were travelling through a contested area they would dive during the day, but would usually proceed slowly on battery, because 12 hours at 2 knots is 24 nautical miles, and contested areas usually weren't huge.
The battery capacity needed for underwater travel is large, so the "hotel load" for lighting wasn't a problem in underwater endurance without movement. In practice, they would usually keep moving slowly, because that means you're actually in control of the boat, which is largely exercised through the rudder and diving planes.
The limit on underwater endurance was the breathability of the air in the boat, because they did not have CO2 scrubbers. It was normal, when it was expected that a submergence would be lengthy, to send most of the crew to bunks, to minimise their activity and thus their air consumption. The only way to refresh the air was to release compressed air from the air banks into the hull. This raised the pressure inside the sub, but this was usually limited to an extra half atmosphere or so, which wasn't a major problem provided you were careful when you first opened a hatch.
Staying down for 24 hours would be unpleasant. 48 hours is probably about the limit. The exact figure depends on the size of the submarine, the number of people on board, the amount of activity, the amount of danger - adrenalin makes people breathe faster - the thoroughness with which the sub was ventilated before diving, and so on.
Edit: If you aren't snorkelling, the depth you're at doesn't make much difference to submerged endurance. But read on for the small differences.
"Maximum depth" for a submarine is a slightly complicated concept. There is "test depth", the depth the submarine is definitely capable of achieving without being damaged, and there is "crush depth" the depth at which the pressure hull collapses. Since that will depend on the weakest point in the hull, a submarine captain does not know what his exact crush depth is. He knows what safety factor the boat was designed for over its test depth, but he doesn't know if the hull has weak points. Assuming there are none would be unwise.
At test depth, there will already be substantial creaking from the structure as it compresses under the sea pressure. Below test depth, the hull plates may well start to bulge inwards between the frames that support them, and there will likely be leaks. At some point, as you carry on going deeper, something breaks, and then the whole boat floods instantly. Even going to test depth causes metal fatigue, but this wasn't understood during WWII.
When you're very deep, you want to move slowly. This is because of the possibility of failure of the depth plane controls. If you're deep, and moving fast, and depth plane control unexpectedly switches to "dive", you can easily put the bow of the boat below crush depth before you regain control. And if that happens, you die. So moving at great depth has to be done carefully.
Going very deep to evade attack is thus dangerous, and will raise the stress levels of the crew and make them consume more air.