The expression "honest Abe" was used as a political slogan in the 1860 presidential campaign, and because of its use in a political context, there are many, many stories of how it came to be. In fact, its first widespread mention was at the Republican presidential convention in Chicago in 1860. Richard Oglesby, a friend of Lincoln's, used the nickname "Honest Old Abe" and "Lincoln the Rail-Splitter". He may have been re-using a slogan from even earlier. As /u/rkiga points out below, there was a Lincoln banner that proclaimed "An Honest Vote for Honest Abe," and was used during the 1858 U.S. Senate race. According to Lowell Harrison's Lincoln of Kentucky, at the state Republican political convention in Decatur, Illinois, Oglesby organized a parade of two decorated fence rails emblazoned with the slogan "ABRAHAM LINCOLN THE RAIL CANDIDATE FOR PRESIDENT IN 1860". Other messages stated that the rails were two of 3,000 created by Thomas Hanks (a Lincoln cousin) and Abe Lincoln, whose father was the first pioneer of Macon County (Illinois).
This wasn't wholly accurate, but that image of a hard-working common man was spread through books, pamphlets, newspapers, songs and every other bit of campaign ephemera that existed.
But while we know when and why the slogan spread, I suspect the nickname's origin arose because of many incidents, all adding up to a whole that was magnified during the political campaign of 1860. Adding to the problem of identifying a single origin point is Lincoln's tragic assassination, which meant, as Stephen Oates points out, "the man became obscured in an outpouring of flowery orations and tear-filled eulogies. As the seasons passed, Lincoln went on to legend and martyrdom, inflated by the myth makers into a godly Emancipator who personified America's ideal Everyman."
Yet even Oates concludes, "No, Lincoln was as honest in real life as in the legend. Even his enemies conceded that he was incorruptible."
The cockfighting story comes from William Henry Herndon and Jesse William Veik's Herndon's Lincoln: The True Story of a Great Life, which was published in 1889. Herndon was Lincoln's third and final law partner, joining the future president in 1844. Herndon isn't an impartial observer of Lincoln, but I'll reproduce his account below for your reference. Herndon says he got the account of this incident from A.Y. Ellis, who was a merchant in New Salem, Illinois when Lincoln lived there from 1831 to 1837.
"At this time in its brief history New Salem was what in the parlance of large cities would be called a fast place ... It remains a matter of surprise that Lincoln was able to retain his popularity with the hosts of young men of his own age, and still not join them in their drinking bouts and carousals. 'I am certain,' contends [A.Y. Ellis] that he never drank any intoxicating liquors─he did not even in those days smoke or chew tobacco.' In sports requiring either muscle or skill he took no little interest. He indulged in all the games of the day, even to a horse-race or cock-fight. At one eventful chicken fight, where a fee of 25 cents for the entrance of each fowl was assessed, one Bap. McNabb brought a little red rooster, whose fighting qualities had been well advertised for days in advance by his owner. Much interest was naturally taken in the contest. As the outcome of these contests was generally a quarrel, in which each man, charging foul play, seized his victim, they chose Lincoln umpire, relying not only on his fairness but his ability to enforce his decisions ... "
More likely than a single event like this one was a multitude of smaller incidents that gave Lincoln his "honest" nickname and allowed him to keep it. The biography The Pioneer Boy, and How He Became President was published for children in 1863, and Lincoln himself was consulted by its author. It shares the story of Lincoln, who borrowed a book, only to have it ruined by rain seeping through the walls of his home cabin. He worked for three days to replace the book.
Oates' With Malice Toward None: The Life of Abraham Lincoln and other popular biographies share the story of Lincoln's failed business, the Berry Lincoln Store, which left him so much in debt that he needed 15 years to pay it all back -- and he did.
A few more instances are referenced in Benjamin Thomas' Lincoln's New Salem, which was first published in 1934 and covers Lincoln's life in that Illinois community at the time of the cockfighting incident. This book was published (as was Herndon's) during the "myth-making" period of Lincoln historiography, so keep that in mind. As Thomas himself wrote: "The exact proportion of truth in these tales of miraculous achievement is of no great importance."
Still, if we are to get to the bottom of this, we must examine the evidence, such as it is:
"People recollected his honesty and kindness. In making change for a woman, while working in Offut's store, he took out six and a quarter cents too much, and at closing time, discovering his error, walked six miles to return the money. On another occasion, after weighing out some tea, he found a four ounce weight on the scales, and again walked several miles to correct his mistake. Such acts as these won him the nickname "Honest Abe." He helped a barefoot boy split rails to get money to buy a pair of shoes. He offered the horse on which he was riding to Doctor Chandler of Chandlerville to help him get to the Land Office ahead of a "land shark" who wanted his farm. In re-surveying the town of Petersburg he ran the lines out of plumb to prevent the house of Jemima Elmore, widow of a comrade in the Black Hawk War, from being in the street. When a loafer offended his women customers by persistent swearing he took him out and thrashed him. Sometimes he restrained his rash associates from an especially cruel prank. He stopped them from rolling an old drunkard down the bluff in a barrel, although the victim had agreed to let them do it for a drink. He dissuaded Jack Armstrong from thrashing a stranger who refused to be bullied."
By 1850, Lincoln had established a career as a good lawyer and a middling-to-minor politician. Following his death, a document fragment dated July 1, 1850 was found in his notes. It may have been written later, but in any case it was intended for a law lecture for young lawyers. Lincoln wrote in part:
"There is a vague popular belief that lawyers are necessarily dishonest. I say vague, because when we consider to what extent confidence and honors are reposed in and conferred upon lawyers by the people, it appears improbable that their impression of dishonesty is very distinct and vivid. Yet the impression is common, almost universal. Let no young man choosing the law for a calling for a moment yield to the popular belief ─ resolve to be honest at all events; and if in your own judgment you cannot be an honest lawyer, resolve to be honest without being a lawyer. Choose some other occupation, rather than one in the choosing of which you do, in advance, consent to be a knave."
The person who kept alive the idea of "honest Abe" more than anyone else was without a doubt Carl Sandburg. His mammoth multi-volume biography of Lincoln was perhaps the peak of the myth-making Lincoln ideal. In 1909, Sandburg -- then working as a newspaper columnist in Wisconsin -- wrote about how ideal it was to use Lincoln's face on the penny. "The common, homely face of “Honest Abe” will look good on the penny, the coin of the common folk from whom he came and to whom he belongs."
In no small part, Sandburg's writing has meant that regardless of where the nickname comes from, we remember it.