With regard to when the term "gym rat" was first used, an Elephind newspaper database search returns matches three matches from the 1960s. From "Gossip!!" in the [Wise, Virginia] Highland Cavalier (June 1, 1964):
If given a choice would you rather be a gym rat, lounge lizard, a library louse, a Tate House Toad, a Dorm Drunk, a Riner House Ringworm or a Baker house Buzzard?"
From "DePauw Student Entrepreneur to Star Golden Gloves Quest" in the [Indianapolis, Indiana] Jewish Post (December 29, 1967):
In preparation for the first round in St. Louis he has become what at least one DePauw coach rather admiringly calls, "a gym rat. He’s there when we open up and he’s there when we close."
And from "The Sentinel's 1969 All-County Cage Team," in the Santa Cruz [California] Sentinel (March 9, 1969):
The other sophomore is the often-spoken-about Rodger Carr of San Lorenzo Valley. The lanky, 6-3, guard-forward is known as the "Gym Rat" for hours of dedicated work on the basketball court.
As the latter two quotations suggest, the key characteristic of a human "gym rat" is to spend all day every day at the gym—practicing, playing, exercising, or just hanging around. The implication of the term is that the "gym rat" effectively lives at the gym, which something that no other creature, except perhaps a rat, would do.
Robert Chapman & Barbara Kipfer, Dictionary of American Slang, third edition (1995) has this brief entry for the expression:
gym rat n phr by 1970s An athlete; a person who frequents gymnasiums: ... a thin, fortunate group of very highly paid gym rats ... —Milwaukee [Wisconsin] Journal
Tom Dalzell & Terry Victor, The New Partridge Dictionary of Slang and Unconventional English (2006) offers an even later coinage date for the term:
gym rat noun an exercise fanatic US, 1978 | In a grim twist that could fit into one of his songs, in the past year [Warren] Zevon has been a gym rat ("I was working out more than Vin Diesel," he says) and assumed that his shortness of breath and the tightness in his chest were side effects of his regimen. — Los Angeles Times, 13th September 2002
Imagine my surprise, then, when a Google Books search turned up two instances from the 1910s.
From an epigraph/caption in The Illio: A Year Book Produced by the Junior Class at the University of Illinois (1915):
A gym rat graduated with honor.—FERGUSON.
"Ferguson" appears to be Clarence Milford Ferguson, one of the eight University of Illinois seniors whose accomplishments are recorded on the accompanying page of the yearbook; his include "Pushball Committee," "Assistant Manager Varsity Baseball," and "Manager."
And from Charles Collins, The Natural Law (1916):
This Freddie Donlin was a droll demonstration of the cultural value of college athletics. His student days were over. He had managed to squeak through the prescribed courses of study to a degree of Bachelor of Arts two years before, but instead of going out into the world to conquer, according to the advice f the commencement day orators, he had clung closely to the gymnasium, where so much of his time in college had been spent, and had contrived to get on the pay-roll of his Alma Mater as the guide, philosopher and friend of aspiring athletes. He directed the elementary calisthenics of a few gymnasium classes, but his important duties were with the members of the track team, and those who strove to qualify for places in that exalted organization.
Runners were Freddie's specialty, for he had been one himself. He coached them, groomed them, and watched over them with the enthusiasm of a fanatic. He praised or rebuked them, according to their performances; he told them how they should eat, drink, and sleep; he was the fate that directed their lives. He was, moreover, the wag of the training table and the low comedian of the athletic field. Deficient in personal ambition, his dreams of conquest by the team he coached were Napoleonic. A "gym rat" was the picturesque definition for Freddie in the college vernacular. But he was a pervasive and influential rodent, amusing enough to be a welcome member of the "easel parties," as Della called them, of which Jack Bowling was the central figure.
It thus appears that "gym rat" had some currency in college slang in the 1910s, in much the same sense that it had in the 1960s and later. Whether the occurrences are coincidental or evidence of a continuous line of long-unrecognized usage from 1915 onward is unclear to me.