Gray was baptised in 1696, the only son of George Gray, a glazier and local landowner, and his wife Elizabeth. He was educated at Colchester Royal Grammar School from 1702, before possibly spending some time at Cambridge University and entering Gray's Inn to become a lawyer in 1724. He was called to the bar in 1729 and became a bencher in 1737. Finally, he was elected a fellow of the Royal Society in 1754. In 1726 he married Sarah Creffield, née Webster, the well-off widow of Ralph Creffield, and after her death in 1751, in 1755 Gray married Mary, the daughter of Randle Wilbraham, Member of Parliament for Newton, Lancashire.
