Gunn was born at Wick in Caithness in 1774, and was educated at the high school, Edinburgh, and trained for the ministry by Greville Ewing at Glasgow.
Gunn was born at Wick in Caithness in 1774,the son of Ingram Gunn, and his wife Elizabeth Miller (or Millar). He was educated at the high school, Edinburgh, and trained for the ministry by Greville Ewing at Glasgow.