Gregory was born in Virginia on July 8, 1804, and was a member of the Virginia state House of Delegates from 1831 to 1840. He served as acting Governor of Virginia from 1842 to 1843 and then as a state court judge in Virginia Gregory died on April 9, 1884, and was buried at Shockoe Hill Cemetery in Richmond, Virginia. One of the enslaved people that Gregory hired, John Dunjee, escaped and became a prominent Baptist preacher.