Why Masturbation Is a Sin
Is masturbation a sin?
The Church has always definitively taught that masturbation is "an intrinsically and gravely disordered action" (CCC 2352). It is a corollary teaching of the Sixth Commandment. And when committed with full knowledge and complete consent (CCC 1859), it is a mortal sin (see CCC 1854-64).
For more on this matter and living a chaste life in general, see the linked CCC cites and see also the resources at the Catholic Answers website Chastity.com.