Gray was an avid reader even in his youth. He completed Clinton Grammar School from about 1823 to 1825, in those years reading many books from the nearby library at Hamilton College. In 1825 he enrolled at Fairfield Academy, switching to its Fairfield Medical College, also known as the Medical College of the Western District of Fairfield, in autumn 1826. It was during this time that Gray began to mount botanical specimens. On a trip to New York City, he attempted to meet with John Torrey to get assistance in identifying specimens, but Torrey was not home, so Gray left the specimens at Torrey's house. Torrey was so impressed with Gray's specimens that he began a correspondence with him. Gray graduated and became an M.D. in February 1831, even though he was not yet 21 years of age, which was a requirement at the time. Although Gray did open a medical office in Bridgewater, New York, where he had served an apprenticeship with Doctor John Foote Trowbridge while he was in medical school, he never truly practiced medicine, as he enjoyed botany more. It was around this time that he began making explorations in New York and New Jersey. By autumn 1831 he had all but given up his medical practice to devote more time to botany.