He could not afford to attend the law school, and he began to study privately, being admitted to the bar in 1854. He practiced law in Corydon and was elected to the state legislature in 1860.
He served in the Union Army throughout the Civil War, was severely wounded, and retired with the rank of major general of volunteers. He then settled in New Albany, Ind., and in 1866 stood as Republican candidate for Congress, but was defeated.
In 1869 President Ulysses S. Grant appointed him United States district judge in Indiana. President Chester A. Arthur in 1883 appointed him postmaster general, and in that position Gresham recommended that a law be passed to prevent lottery materials from passing through the mails.
In 1884 President Arthur appointed Gresham secretary of the Treasury, and later in the same year appointed him United States circuit judge. At the Republican National Convention in 1884, and again in 1888, Gresham was suggested as a presidential nominee but on both occasions he failed to win the candidacy. His growing hostility toward protective tariffs separated him from the Republicans and in 1892 he was offered the presidential nomination by the Populist Party. Gresham declined this offer, however, and became a Democrat.
President Grover Cleveland appointed him secretary of state in 1893, a position he held with distinction until his death in Washington, D.C., May 28, 1895.