Originally a Democrat and later a Whig, Gorham was one of the founders of the Republican party when it was organized in the mid-1850s. In 1855 he was appointed Major General and commander of one of three divisions in the state militia, and in 1859 he was elected to one term in the Michigan State Senate. Gorham used both positions to recruit, train, and reorganize the militia in anticipation of the Civil War. He was a Delegate to the Republican National Conventions of 1864 and 1868, and served as a Presidential elector from Michigan in 1868, casting votes for the ticket of Ulysses S. Grant and Schuyler Colfax.