A lot of good answers, but only one of them even remotely mentioned a specific trick that US WW2 Submariners did to get extra range, and by the end of the war, was made standard practice for the Fleet Type Submarines like the Gato and Balao classes.
Submarines have 3 groupings of Ballast tanks according to design function.
Main Ballast Tanks (Uses for Surfacing and Diving)
Variable Ballast tanks (Used as part of the trim system to keep the sub in neutral buoyancy)
Special Ballast Tanks (Three tanks with unique functions… Negative, Safety, and Bow Buoyancy)
The Submarines had a lot of reserve buoyancy and really did not need all the Main Ballast Tanks it did to remain safely surfaced. So several enterprising Sub Commanders, such as Dick O’Kane and his USS Tang… had several of the Main Ballast Tanks fitted with the proper valves and gaskets to isolate several of the MBTs for use as extra Fuel Oil Tanks.
After enough fuel oil was burned off out of the Normal Fuel Oil tanks… the fuel in the Ballast tanks was transferred over, a short work of a few divers over the side to remove the covers from the Flood Ports (MBTs are normally open and free-flooding from beneath), and then several flooding and blowing of the tanks to flush any residual oil that may leave a slick (done while the sub was on some other course than its actual course), the tank was converted back into use as a Main Ballast Tank.
By the end of the war and during the the post war period while these subs were still in use, this became standard practice and a specific set of tanks was known as Fuel Ballast Tanks (FBT), as opposed to Main Ballast Tanks(MBT) and Normal Fuel Oil Tanks (NFOT)
If you look at the numbering system of the tanks, you will note that the MBTs are number 1,2,6,and 7., What used to be MBT 3,4 and 5, are now the Fuel Ballast Tanks.

If you compare the Fuel Ballast tanks to the Normal Fuel Oil tanks… Seen here as the Red and Orange tanks…

You can see just how much extra those tanks gave the sub above and beyond its normal fuel capacity, and thus its range capability. (though in your initial question you were clearly confusing km with nm)
Normal Fuel Oil Tanks
1. NFOT No. 1 : 11,401 gallons
2. NFOT No. 2 : 13,122 gallons
3. NFOT No. 6 : 15,201 gallons
4. NFOT No. 7 : 10,054 gallons
Total : 49,776 Gallons of Fuel oil
Fuel Ballast Tanks
1. FBT Nos. 3A and 3B : 19,196 gallons
2. FBT Nos. 4A and 4B : 24,089 gallons
3. FBT Nos. 5A and 5B : 19,458 gallons
Total : 62,743 Gallons of Fuel Oil
They carried more fuel in those converted Ballast tanks than they did in their regular fuel tanks.
That is 126% more fuel than normal
More than double the fuel.