It's from his novel, Vanity Fair, originally published in 1847. The book is readable online at http://selfknowledge.com/vfair10.htm
It's not a religious quote, and the original context is somewhat harsh. The passage in question is about a boy who worships his mother, who barely notices his...