The quote you’re describing is from Meetings with Remarkable Men . It’s listed in the book as part of a collection of what Gurdjieff called “subjective sayings” that his father would often use in conversations. Gurdjieff included that list of sayings in order to paint the reader a picture of the type of man his father was, since most of his father’s writings were lost after he was murdered and his house was sacked by vandals.
So even though that quote is often attributed to Gurdjieff, he did not claim authorship of it (besides putting it in his book, of course, and attributing it to his father).
Gurdjieff did believe in God. In Beelzebub’s Tales to his Grandson , he described Him as “All Loving,” “Endlessly Merciful,” “Absolutely Just,” and “All Embracing.” Though as I alluded to above, the details are somewhat esoteric.