Holden talks about religion and prayer in Chapter 14. This is after his encounter with the young prostitute called Sunny and before she returns with Maurice to try to extort another five dollars.
Finally, though, I got undressed and got in bed. I felt like praying or something, when I was in bed, but I couldn't do it. I can't always pray when I feel like it. In the first place, I'm sort of an atheist.
Holden doesn't understand his own feelings. He has often been compared with Huckleberry Finn, and in this chapter he strongly resembles Huck, who was agonizing over the conflict between his sympathy for Jim and his feelings for the righteousness of the institution of slavery acquired from his elders. Holden has had an unnerving experience with Sunny. He has come face to face, probably for the first time in his life, with the ugly reality of prostitution. He sees how depraved it is for one human being to exploit another for such a sordid purpose, whether Sunny was aware of it or not.
The encounter makes Holden feel depressed and possibly even damned. He doesn't have a very good opinion of himself as it is, but descending into a new level of delinquency makes him feel guilty, frightened, apprehensive, exposed to the big-time consequences of sinful behavior that come with the end of childhood. He feels like praying, as he says, but, like many modern men, he is "a sort of an atheist." He doesn't know what to believe. That is Holden's number-one problem.
The reader feels sorry for this lonely boy in this particular chapter. Here he is in a cheap hotel late at night in one of the world's biggest and toughest cities. His parents have no idea where he is. They think he's still at Pencey. His experiment at being a man about town has been a huge disappointment, and it is actually beginning to seem a little bit dangerous. New York can be a spooky place.
The Gideons place Bibles in hotel rooms across the land for lonely travelers experiencing just such existential crises as Holden is having after his encounter with an ignorant young prostitute with whom he couldn't perform because he couldn't feel the love that for him had to go with it.
Characteristically, Holden represses his bourgeoning fears by indulging in reminiscence and abstract thoughts.
I like Jesus and all, but I don't care too much for most of the other stuff in the Bible....If you want to know the truth, I can't even stand ministers. The ones they've had at every school I've gone to, they all have these Holy Joe voices when they start giving their sermons....They sound so phony when they talk....Anyway, when I was in bed, I couldn't pray worth a damn. Every time I got started, I kept picturing old Sunny calling me a crumb-bum.
His thoughts about prayer and religion, such as they are, are interrupted by the ominous knocking at the door of his lonely little hotel room. It is Sunny and Maurice, two petty grifters who want to extort another five dollars from a customer they recognize as a soft touch because of his youth, inexperience, and vulnerability.
"Want your parents to know you spent the night with a whore? High-class kid like you?" He was pretty sharp, in his crumby way.
Perhaps Holden's brief meditation on morality and religion have given him the inspiration and fortitude to resist the evil represented by the tough and worldly-wise but ignorant Maurice. Even though Holden loses the five dollars, we feel he has won a moral victory and is probably going to be all right.