Let no man despise thy youth; but be thou an example of the believers, in word, in conversation, in charity, in spirit, in faith, in purity. (1 Timothy 4:12 KJV).We ought to be an example in purity. I think it means an abstaining from sexual filth. I think that when believers in Christ sin a sexual evil, they ought to repent of that sin immediately. I would say that lust is a sin that violates purity. We ought to repent of lust in our lives. I would say that masturbation violates purity. We ought to repent of that if it emerges in our life. Here is a quotation on lust and purity,
The man who carries on an act of impurity is not simply breaking a human code, nor even sinning against the God who at some time in the past gave him the gift of the Spirit. He is sinning against the God who is present at that moment, against One who continually gives the Spirit. The impure act is an act of despite against God’s good gift at the very moment it is being proffered… This sin is seen in its true light only when it is seen as a preference for impurity rather than a Spirit who is holy. (Leon Morris, The First and Second Epistles to the Thessalonians, Eerdmans, 1959, p. 128).
Here is another quotation,
It's in the true light of the Spirit of God that we conquer lust; however, lust will probably always be there to harm us but we can conquer it through faith and repentance toward God through Christ crucified.A person who gratifies himself (masturbates) is totally self-focused. This act is clearly not the right use of our intimate parts. Our bodies do not belong to us but to God and to our spouse; otherwise, we’re being selfish (1 Corinthians 7:4; 13:5). Another reason masturbation is wrong is because it usually involves engaging in lustful thoughts (Philippians 4:8). A third reason is that it becomes a very enslaving activity (1 Corinthians 6:12). Finally, it removes any need of self-control in the sexual area (1 Corinthians 7:1-2; Galatians 5:22-23). (Stuart Scott The Exemplary Husband, Focus, 200, p. 150).