I'm not sure about all religions, but this is something I've been looking into myself lately.
From what I've been reading, Christianity is sort of...against such things unless you're married.
There's even articles people have written about the subject that pretty much say that for single Christians sex, porn, masturbation, and sexual fantasies of any nature (even about fictional characters) are sinful.
I'm not sure how true that is, it's just what I've been reading.
All I know is, if that's how it is...I'm probably going to be sinning most of my life. I like masturbation, porn, and sexual fantasies...my boyfriend doesn't have a problem with my doing any of that either. In fact, he tends to encourage it since he knows it's all harmless fun.
And then there's the whole thing about sex with anyone you're not married to being a sin, even if you're in a relationship with that person.
The material I've been reading even goes so far as to compare a sexual fantasy to actual cheating since you've "already been with" the person in the fantasy in your mind.
Given all this, I'm pretty sure it's not the right religion for me even though it's the one I'd like to follow. I don't want to have to feel like even just getting off is something I should feel guilty for, especially since I know I'd never cheat on my partner or do anything that I personally see as sinful.