About 8-10 knots will ensure the greatest range with any fleet boat. Below or above that, your engines will consume too much per mile travelled. If you wish to combine range with time, approximately 12 knots will be your choice.
Some people consider the 8-10 knots speed to be a glitch in the game, because it makes your fleet boat able to travel unrealistically far. I usually travel at 12 knots to my area of operation and set speed at 10 when patrolling inside it.
If you play stock, I recommend downloading Webster's Better Sub mod. It does nothing to the game exept setting the speed according to these values. (Ahead 2/3 for longest range, ahead standard for time/range.) The speed values in stock are silly.
Webster's Better Sub(speed) can be found here:
http://www.subsim.com/radioroom/showthread.php?t=152897