Is it true that masturbating to much in the teenage years to mid 20s can put you at risk for prostate cancer?

Myth. There are many such associations passed by word of mouth.You also don't go blind,don't become infertile, etc.Many cultures find this normal area of sexuality something to discourage and such myths are part of the effort.
No. That is just a lie. I am sorry someone troubled you with this nonsense. If this comes from a "spiritual advisor" or "health guide", draw the obvious conclusion and move on to something healthier.