Son of Philip Gray, a money scrivener, and Dorothy Antrobus, a milliner.
Gray went to Eton in 1727, where he became close friends with Horace Walpole (1717-1797, later to become MP and the inventor of the Gothic novel) and Richard West (poet, d. 1742). In 1734 he matriculated at Peterhouse College, Cambridge together with Walpole.
In March 1739 he started out on a Grand Tour of Europe together with Walpole, and for the next couple of years, the two visited France and Italy, staying in Paris, Florence, Rome, Naples and other cities. In April 1741, however, they had a major quarrel, leading to their separation and they weren't reconciled until 1745.
Having returned home, he finally was awarded his LL.B. from Peterhouse in 1744.
Gray was fairly productive as a poet during the 1740s, but none of his writings was published until 1748, when his "Ode on a Distant Prospect of Eton College", "Ode on Spring" and "Ode on the Death of a Favourite Cat, Drowned in a Tub of Gold Fishes" were published anonymously in Robert Dodsley's "Miscellany". Then in 1750 was published his perhaps most famous "Elegy Written in a Country Churchyard", and in 1753 his completed poems up to that time were put together in a single volume illustrated by Richard Bentley and published also by Dodsley.
Later he wrote "The Progress of Poesy", "The Bard", two "Norse Odes" as well as other lesser-known works.
Although considered to be a major figure in English 18th century poetry, he was also very self-critical and it has been estimated that at the time of his death, only about 1000 lines of his had been published. Despite this, his few poems are sources of many well-known phrases and proverbs, including "where ignorace is bliss, 'tis folly to be wise" (from the Eton ode), "a fav'rite has no friend" and "nor all that glisters, gold" (both from the elegy on the death of the cat).
It is uncertain if Boswell ever met Gray, but he was well-acquainted with his poems from an early age. Boswell's close friend William Temple became a friend of Gray's at Cambridge, and in a letter of May 16, 1766, to Temple, Boswell reflects on comments relayed to him by Temple in an earlier letter, concerning Boswell's thoughts of writing what was to become his Account of Corsica:
"So Mr. Gray thinks I should publish my Account of Corsica soon. I am afraid he has had a fit of ennui and just wished for something to amuse him. [...] Pray offer my respectful compliments to Mr. Gray, and tell him that as I was but five weeks in Corsica, I cannot be expected to have materials enough to furnish anything like a complete account of it. [...] Would Mr. Gray give me his advice as to the form in which I should write? What shall be the title? [etc.]" 1
The works of Gray are widely available in various forms and editions via AbeBooks.