He was the son of Nathaniel Gorham, who served as one of the Presidents of the Continental Congress.
He was elected as a Democratic-Republican to the Sixteenth Congress to fill the vacancy caused by the resignation of Jonathan Mason; he was re-elected when the term expired, and served until March 3, 1823.
Afterwards he returned to the State senate for one term beginning May 28, 1823, before being elected as an Adams candidate to the Twentieth Congress to fill the vacancy caused by the resignation of Daniel Webster and then reelected as an Anti-Jacksonian to the Twenty-first Congress and served from July 23, 1827, to March 3, 1831.
Afterward he served again a member of the State house of representatives in 1841 and resumed the practice of law.
He died in Boston in 1855, aged 80, and was interred in the Phipps Street Burying Ground in Charlestown.