He accompanied his family moving to Edinburgh in 1764, and after going through the usual course of literary studies at that university, he was for a short time a student at Christ Church, Oxford.
[1] Shortly after his return to Scotland, he was appointed in 1776 to the chair his father had formerly held, and in the following year he also entered on the duties of teacher of clinical medicine in the Edinburgh Royal Infirmary.
[1] As a medical practitioner Gregory was for the last ten years of his life at the head of the profession in Scotland[1] (for part of which time he was in partnership with Thomas Brown, M.D.).
The family lived together in their father's huge Georgian townhouse at 10 Ainslie Place on the Moray Estate in the eastern New Town of Edinburgh.
Gregory died after being run over by a horse and carriage in St Andrew Square in Edinburgh on 2 April 1821 and was buried in Canongate Kirkyard on the Royal Mile.