He was educated at Merchant Taylors' School from 1731 to 1740, and in June 1740 was elected to a scholarship at St John's College, Oxford.
He held a succession of ecclesiastical benefices: Holy Sepulchre in Northampton from 1748 to 1762; Ecton from 1762 to 1763; and Preston Deanery from 1753 to 1766.
In 1760 he succeeded James Townley in the post of upper grammar master at Christ's Hospital, and retained it until the summer of 1776.
He was appointed on 5 February 1766 by the corporation of the City of London to the rectory of the united parishes of St Margaret Pattens and St Gabriel, Fenchurch Street, London; and in 1768 he was presented by Christ's Hospital to the vicarage of Horley in Surrey.
He lived for some months concealed in the house of his friend Francis Godolphin Waldron, but his hiding-place was discovered and he left for Flanders.
When in 1755 Benjamin Buckler declined the work of preparing for publication the manuscripts of John Bridges' county history of Northamptonshire, the task was given to Whalley.