Gradual in my case, plus plenty of reading...esp on Einstein's theories on religion.
Methodist family, strict grandfather as a practising lay preacher, only book on Sunday the Bible, biblical toys only on Sunday and the chapel twice a day - inc Sunday school.
My father, once out of his clutches, did not "preach" or enforce though.
Middle School prize in Divinity (on comparative religion - still interested in the philosophies and logic) but managed to fail the O level (bible cramming - and I had Ad Maths the same day. I realised, aged 15, that I did not want to be a Bishop.
General apathy about religion at As and then, after a gap year, through reading science and philosophy, a gradual appreciation of the hogwash, but also an appreciation that the Bible and the Koran writers etc were brilliant at explaining the unexplainable to the uneducated masses....
Einstein's views are interesting in that he does not believe in a personal deity but questions if there is some higher form that has led to the symmetry of the universe.....
And to me, one realises that there has always been space, no beginning, no end, just a continual process (or trillions and trillions of processes) at work, some of which we know, many that we do not yet and the advancement of science will gradually reveal the "onion" to us.