Gray was born in Walsall, but his family soon moved to London, where Gray studied medicine. He assisted his father in writing The Natural Arrangement of British Plants (1821). After being blackballed by the Linnean Society he turned his interest from botany to zoology. He began his zoological career by volunteering to collect insects for the British Museum at age 15. He officially joined the Zoological Department in 1824 to help John George Children catalog the reptile collection. In 1840 he took over from Children as Keeper of Zoology, which he continued for 35 years, publishing well over 1000 papers. He named many cetacean species, genera, subfamilies, and families.
Gray's term at the British Museum coincided with the most active period of Australian exploration and settlement. Most of the specimens of animals collected on surveying voyages and exploring expeditions before 1850, and collections made by immigrant naturalists such as Ronald Gunn in Tasmania and by John Gould and his field workers, John Gilbert and Frederick Strange, were acquired by the British Museum. Gray described and named scientifically many of these new animals, particularly reptiles and mammals, but also some frogs, fishes, a few species of birds, and some invertebrates. Many of the common Australian animals, particularly reptiles, have scientific names given to them by Gray. His descriptions were issued in English natural history periodicals, catalogues of the British Museum, and appendixes to narratives of voyages and journals of exploration such as those by Phillip Parker King, John Lort Stokes, Joseph Jukes and Edward John Eyre. Gray's appendixes to George Grey's journals are particularly important as they contain the original descriptions of a considerable number of reptiles and mammals, and also give complete lists of all Australian mammals, reptiles, and frogs and their geographical distributions, known at that date.
Gray's contribution to Australian zoology was second only to that of Gould among his contemporaries. His published works are still frequently consulted by students of the classification and nomenclature of Australian animals. The superficial nature of his descriptions, however, and the many unnecessary changes of scientific names that he made, cause confusion even to this day. Fortunately the great majority of the type specimens which were before him when he wrote the descriptions are still preserved in the British Museum, registered under the numbering system he invented, and most problems can be solved by reference to these originals.