Lincoln did, even as a boy, largely reject organized religion, but the Calvinistic "doctrine of necessity" would remain a factor throughout his life. In 1846 Lincoln described the effect of this doctrine as "that the human mind is impelled to action, or held in rest by some power, over which the mind itself has no control." In April 1864, in justifying his actions in regard to Emancipation, Lincoln wrote, "I claim not to have controlled events, but confess plainly that events have controlled me. Now, at the end of three years struggle the nation's condition is not what either party, or any man devised, or expected. God alone can claim it."
As Lincoln matured, and especially during his term as president, the idea of a divine will somehow interacting with human affairs more and more influenced his public expressions. On a personal level, the death of his son Willie in February 1862 may have caused Lincoln to look towards religion for answers and solace.
Lincoln’s religious skepticism was fueled by his exposure to the ideas of the Lockean Enlightenment and classical liberalism, especially economic liberalism. Consistent with the common practice of the Whig party, Lincoln would often use the Declaration of Independence as the philosophical and moral expression of these two philosophies. It was the Declaration of Independence, rather than the Bible, that Lincoln most relied on in order to oppose any further territorial expansion of slavery. He saw the Declaration as more than a political document. To him, as well as to many abolitionists and other antislavery leaders, it was, foremost, a moral document that had forever determined valuable criteria in shaping the future of the nation.
http://www.adherents.com/people/pl/Abraham_Lincoln.html
http://www.positiveatheism.org/hist/steiner0.htm
http://www.pointsouth.com/lincoln/religion.htm
These are a few sites for more reading about his views.