When I was young, I did the secret habit (masturbation) from the age of on it; if I did it I did not do ghusl and I used to pray and fast after that.
If the masturbation involves ejaculation (whether you are male or female), then performing ghusl becomes obligatory. You cannot pray until you.
As-salamu `alaykum. Do I need to have ghusl after I masturbate?.