A torpedo bomber is a bomber aircraft designed primarily to attack ships with torpedoes. This requires a long bomb-bay to carry the "fish," which explains why there would be a special type of plane for this role.
Torpedo bombers existed almost exclusively prior to and during WWII. During the war they were an important player in many famous battles, notably the British attack at Taranto and the Japanese attack on Pearl Harbor. Torpedo bombers disappeared almost immediately at the end of the war, replaced by more generalized aircraft, and then missiles. Since the mid 1950s some maritime strike aircraft and helicopters have been capable of launching torpedoes.
Some important torpedo bombers: