Thomas Jefferson was a man of deep religious conviction — his conviction was that religion was a very personal matter, one which the government had no business getting involved in. He was vilified by his political opponents for his role in the passage of the 1786 Virginia Statute for Religious Freedom and for his criticism of such biblical events as the Great Flood and the theological age of the Earth. As president, he discontinued the practice started by his predecessors George Washington and John Adams of proclaiming days of fasting and thanksgiving. He was a staunch believer in the separation of church and state.
Jefferson wrote a letter to the Danbury Baptist Association in 1802 to answer a letter from them written in October 1801. A copy of the Danbury letter is available here. The Danbury Baptists were a religious minority in Connecticut, and they complained that in their state, the religious liberties they enjoyed were not seen as immutable rights, but as privileges granted by the legislature — as "favors granted." Jefferson's reply did not address their concerns about problems with state establishment of religion — only of establishment on the national level. The letter contains the phrase "wall of separation between church and state," which led to the short-hand for the Establishment Clause that we use today: "Separation of church and state."
The letter was the subject of intense scrutiny by Jefferson, and he consulted a couple of New England politicians to assure that his words would not offend while still conveying his message: it was not the place of the Congress or the Executive to do anything that might be misconstrued as the establishment of religion.
Note: The bracketed section in the second paragraph had been blocked off for deletion in the final draft of the letter sent to the Danbury Baptists, though it was not actually deleted in Jefferson's draft of the letter. It is included here for completeness. Reflecting upon his knowledge that the letter was far from a mere personal correspondence, Jefferson deleted the block, he noted in the margin, to avoid offending members of his party in the eastern states.
This is a transcript of the final letter as stored online at the Library of Congress, and reflects Jefferson's spelling and punctuation.
To messers Nehemiah Dodge, Ephraim Robbins, & Stephen S. Nelson, a committee of the Danbury Baptist association in the state of Connecticut.
The affectionate sentiments of esteem and approbation which you are so good as to express towards me, on behalf of the Danbury Baptist association, give me the highest satisfaction. my duties dictate a faithful and zealous pursuit of the interests of my constituents, & in proportion as they are persuaded of my fidelity to those duties, the discharge of them becomes more and more pleasing.
Believing with you that religion is a matter which lies solely between Man & his God, that he owes account to none other for his faith or his worship, that the legitimate powers of government reach actions only, & not opinions, I contemplate with sovereign reverence that act of the whole American people which declared that their legislature should "make no law respecting an establishment of religion, or prohibiting the free exercise thereof," thus building a wall of separation between Church & State. [Congress thus inhibited from acts respecting religion, and the Executive authorised only to execute their acts, I have refrained from prescribing even those occasional performances of devotion, practiced indeed by the Executive of another nation as the legal head of its church, but subject here, as religious exercises only to the voluntary regulations and discipline of each respective sect.] Adhering to this expression of the supreme will of the nation in behalf of the rights of conscience, I shall see with sincere satisfaction the progress of those sentiments which tend to restore to man all his natural rights, convinced he has no natural right in opposition to his social duties.
I reciprocate your kind prayers for the protection & blessing of the common father and creator of man, and tender you for yourselves & your religious association assurances of my high respect & esteem.
(signed) Thomas Jefferson