John Gill was a 23rd century historian. Spock was impressed by Gill's treatment of Earth history as "causes and motivations rather than dates and events." James T. Kirk, who studied under Gill at Starfleet Academy, remembered him as "the kindest gentlest man I ever knew." (TOS: "Patterns of Force")
When Captain Kirk and Commander Spock beamed down to Ekos, they were stunned to find a mid-20th century style Nazi state bent on destroying the neighboring planet, Zeon, and all the Zeons living on Ekos. Kirk and Spock were also shocked to learn that John Gill had somehow become the Führer of Ekos.
When Kirk finally managed to locate Gill, the captain found his old history professor in extremely bad health. Apparently, Gill had been drugged by the Deputy Führer, Melakon. After Dr. McCoy administered several injections of a stimulant into Gill's body, Spock performed a mind meld on the historian, enabling Gill to answer Kirk's questions. Gill claimed that when he had first arrived on Ekos, he had found the planet in such a fragmented and divided state that he decided to break the Prime Directive in order to transform Ekos into a simulation of the most efficient state Earth had ever known. According to Gill, his plan had initially worked until Melakon began to drug him.
As Gill's attention returned to his current situation, Kirk urged the historian to notify the Ekosians of Melakon's betrayal before the Final Decision to destroy Zeon began. Gill was able to transmit a message to the Ekosians and tell them to stop the invasion of Zeon. He also apologized to Zeon, insisting that he himself, not the people of Ekos, bore the blame for this aggression. He then denounced Melakon as a traitor, at which point the Deputy Führer grabbed a soldier's machine gun and shot Gill before he himself was killed by Isak. Before Gill died, he admitted to Kirk he was wrong to violate the Prime Directive. (TOS: "Patterns of Force")
In the non-canon reference book the Star Fleet Medical Reference Manual, an essay titled "Historical Trends in Medicine" by John Gill serves as the introduction. He is listed as having a PhD, and references several historical medical landmarks like "The Surgeons Mate" - a real life Navy guide written in the 17th century, and several from the Star Trek universe.