He was born in 1654 (baptised on 18 August) in the manse at Kilbarchan the son of Rev John Stirling and his wife Jean Maxwell.
He was licensed to preach as a Church of Scotland minister by the Presbytery of Glasgow in February 1690.
On 8 May 1701 he was elected Principal of the University of Glasgow in place of William Dunlop and began the role on 18 September.
He created the two new faculties of Law and Medicine to better parallel the subjects offered by other Scottish universities.
[2] In 1707 he was additionally elected Moderator of the General Assembly of the Church of Scotland in succession to William Wishart.