A punishment is done for correction or as retribution for a wrongdoing or crime. It is also supposed to be a deterrent so that one will not repeat the offense.
Torture is done specifically to cause suffering, usually severe suffering. However, torture is also a subjective concept and to a certain point, so is punishment. What is considered punishment by some may be considered tortured by others and vice versa.
Torture often involves totally breaking the will of a person, and replacing it with your own.