Masturbation is a major sin and its punishment has been mentioned in many Hadeeths, that the sinner will come in the Day of Judgement with his hand which he used in masturbation, swollen like a mountain and will bedridden in front of all human beings.
Zina ( fornication) is another major sin, which is different from masturbation.
Wassalam.