The sentiment that Hume was an atheist is not one just shared by laypeople, but also by professional philosophers and historians. In his review of the book Hume: An Intellectual Biography, historian Anthony Gottlieb said the following:
"The principles of Hume's philosophy implied that the question of God's existence cannot be settled definitively either way, so he was in one sense an agnostic. However, since he does not seem to have entertained any belief in God, it is probably also fair to call him an atheist—just not a campaigning one." (Who Was David Hume)Gottlieb is not alone. Richard Dawkins calls Hume an atheist several times in his book The God Delusion, and most non-Hume scholars in philosophy would agree with Gottlieb's sentiment about Hume. As far as Hume scholars are concerned, there are mixed opinions, but leading Hume scholar Paul Russell sees Hume's entire work as trying to undermine theistic claims and show religion and belief in God to be false, as he argues in his book The Riddle of Hume's Treatise.
Ever since Hume published A Treatise of Human Nature in 1738, he has been branded as an atheist and a dogmatic critic of religion. Why this is the case is hard to say, but it likely stems from the fact that God does not play a central role in Hume's philosophy. For example, because Hume is an empiricist (a person who believes sense data is how we obtain knowledge) and a naturalist (he only accounts for natural, testable causes in his philosophy), there is no way for God to play a role in epistemology, human nature, and morality because God cannot be known via sense experience.
To be fair, Hume certainly does criticize religion. In his classic essay Of Miracles, he states that while miracles are not logically impossible, we don't have any good reason to think that they are. Also, in the Treatise Hume criticizes the idea of immaterial soul, that God is the source of morality, and the continuation of selves through time. (Though it should be mentioned that Hume was never fully satisfied with his account of self identity.) Finally, in Dialogues Concerning Natural Religion (assuming one takes the position that Philo is closest to Hume's position, which I dispute here) Hume examines several of the classical arguments for God's existence and finds them all to be defective.
Before we can examine the question of whether Hume was an atheist, we will have to have a working definition of what atheism is. Atheism is the belief that there is no God; it is not a lack of belief in God. Cats and dogs, as far as we know, do not have a belief in God but we do not call cats and dogs atheists. This position is more accurately called non-theism, and it includes those who lack a belief in God or are just not theists in any sense of the term (this is the view that the late Antony Flew championed in his work The Presumption of Atheism.) So, did Hume ever profess that he did not believe in God?
The answer to that question is that not only did he did not make such a proclamation, he was somewhat frightened by atheism. In his writings, Hume labels other people atheists (such as Baruch Spinoza in the Treatise), but he does not call himself one, though he is happy to call himself a moderate skeptic. After Hume released the Treatise, as I mentioned before, he was accused of being an atheist and had to write an anonymous Abstract in order to tell people that the main point he was trying to make was about causality, and had nothing or little to do with whether God existed or not. Despite these efforts, Hume continued to be labeled an atheist and an infidel.
When Hume served as an ambassador to France, he became acquainted with Baron D'Holbach, who was an outspoken atheist. While there, he once had dinner with D'Holbach and many of his friends. Hume mentioned that he had never seen an atheist and was not sure if they even existed. D'Holbach remarked that most of the people at the table were atheists, and the few that were not had not yet made up their minds. This did not seem to have impressed Hume very much, and a friend who knew about the story later wrote to another friend that while Hume did not have enough religion to be popular in Britain, it seemed in France that he had too much.
While many people will say "But Hume is clearly very critical of the idea of a God in his Dialogues," this shows that they have not read the text carefully. The question under consideration in the Dialogues is not whether or not God exists (even Philo says that question has an obvious answer:yes), but whether the nature and attributes of this God can be known through philosophical argument. Hume, like Philo, is skeptical of the latter claim, but not about whether or not God exists.
Hume's position is probably a best thought of as a kind of deism (though even that is questionable because Hume also criticized deists.) In several of his essays, he agreed with the Roman Stoic philosopher Cicero about the utility of religion, and when he talked about how he would set up a government, he mentioned that a national church would be a good, civilizing thing upon society. So, while Hume did criticize religion, he was not anti-religious. Furthermore, what Hume was critical about when it came to religion was not the existence of God so much as it was the attributes of God, which he claimed we could never know about for sure. In his final interview before his death with author James Boswell, Hume mentioned that the morality of religion was bad and that he had stopped being religious when he was a child, but he did not say that he didn't believe in a God. Clearly, for Hume at least, the question of religion and the existence of God were separate ideas. So Hume could believe in an Aristotelian prime mover sort of a God, but not an interventionist God.
While Hume was certainly a critic of religion, there is no reason to believe that he was an atheist. His writings show that he believed in some sort of providence, and atheism was too far of a position for him to take. As a skeptic, Hume was hesitant to make those sort of affirmations. But, the evidence from his essays and his posthumous Dialogues shows that he was a theist in a limited sense.