Atheism of some sort or the other has always existed in Hindu thought. There are clear references to it in the Rāmāyaṇa and the Mahābhārata, including the Bhagavadgītā. But, holding atheistic beliefs has never been a bar to remaining within the Hindu fold.
If the word ‘atheism’ is interpreted as non-belief in the existence of God, then, even the Vedic systems like the Sāṅkhya-darśana and the Mīmāṁsā-darśana, have to be dubbed as atheistic. But the word, the Sanskrit equivalent of which is ‘nāstikatā,’ is generally accepted to mean non-acceptance of the authority of the Vedas. In this sense, the three well-known systems of Indian philosophy—Cārvāka, Jaina and Bauddha darśanas—are classed as ‘nāstika.’