Stanly, the son of John Wright Stanly, was born in New Bern, North Carolina, and educated by private tutors before attending Princeton University. He studied law and was admitted to the bar in 1799. After practicing law and serving as a clerk and master in equity, Stanly was elected to the North Carolina House of Commons in 1798 and 1799.
In 1800, Stanly was elected as a Federalist to the 7th United States Congress (March 4, 1801 – March 3, 1803); he served again in the 11th Congress (March 4, 1809 – March 3, 1811) before returning to the practice of law. Stanly returned to the state house for several more terms, in 1812–1815, 1818–1819, and 1823–1825. He died in New Bern in 1834 and is buried in the local Episcopal Cemetery. He is also known for killing Richard Dobbs Spaight, a signer of the Constitution, in a famous duel in 1802. As a result of the duel, North Carolina outlawed duelling in the state.
Stanly County, North Carolina was formed in 1841, and named in his honor.
- John Stanly at the Biographical Directory of the United States Congress
- A New Nation Votes: American Election Returns 1787-1824 For Votes cast in Federal, State and Local elections in the Early Republic.