(covers information from several alternate timelines)
In the 1930s and 1940s, he was the leader of Nazi Germany sporting the title of Führer. His name was invoked in the Nazi salute, "Heil Hitler". He was defeated at the conclusion of World War II. (TOS: "The City on the Edge of Forever", "Patterns of Force"; VOY: "The Killing Game")
Under Hitler's fascist administration, Germany recovered from having been defeated before and the Great Depression to become the most efficient nation in Earth history, coming close to being a dominant global power. However, the nation's brutality and perverted nature meant that the nation had to be destroyed at great cost. (TOS: "Patterns of Force")
In 2266, Roger Korby believed that by transferring consciousness into an android body, a Human would have practical immortality. James T. Kirk responded that this was programming, comparing Korby with others who had made the same promises, using different words, like Genghis Khan, Julius Caesar, Hitler, Ferris, and Maltuvis. (TOS: "What Are Little Girls Made Of?")
In 2268, Spock listed Hitler with Ramses, Alexander the Great, Caesar, Napoléon, and Lee Kuan as examples of Earthmen whose desire for absolute power corrupted them absolutely. (TOS: "Patterns of Force")
In 2293, in a conversation between Captain Kirk and General Chang, Kirk pointed out that Chang had effectively paraphrased a statement by Hitler from 1938, when Chang stated "We need breathing room". (Star Trek VI: The Undiscovered Country)
In 2364, in a Dixon Hill holo-novel set in 1941, a headline on the front page of the San Francisco Herald proclaimed "Hitler on the Move", followed with the subheading "Roosevelt presses Congress for British aid." (TNG: "The Big Goodbye")
In 2368, Captain Jean-Luc Picard of the USS Enterprise-D agreed with Berlinghoff Rasmussen that saving an endangered planet could hypothetically allow "the next Adolf Hitler or Khan Singh" to come into being, but such philosophical debates didn't help him in solving real problems. (TNG: "A Matter of Time")
Hitler proved much more successful in at least two alternate timelines.
In one timeline, Hitler's success was based on altered events made during the Temporal Cold War, thanks to the actions of the Na'kuhl temporal agent Vosk. In this version of history, Vladimir Lenin was assassinated in 1916 and the Russian Revolution was prevented.
With Russia not being considered a threat, Hitler was able to concentrate on the Western front, and conquered Belgium, France, and Britain in quick succession. He followed his victories in Europe by invading the United States of America, conquering New York City, Washington, DC, and much of the Eastern Seaboard.
In 1944, this Hitler made a state visit to New York and pledged to eradicate "financial profiteers". Temporal agent Daniels sent Jonathan Archer and the starship Enterprise NX-01 to this timeline, where they were able to defeat Vosk and restore the timeline. (ENT: "Zero Hour", "Storm Front", "Storm Front, Part II")
In another timeline, Hitler's success was in part thanks to Leonard McCoy, who traveled back in time to 1930 and saved a woman, Edith Keeler, from a traffic accident. Keeler went on to lead a pacifist movement within the United States of America to convince their government to delay entry into the war.
According to historical documentation of the alternate reality studied by Spock, the absence of American intervention bought the dictator enough time to perfect both V-2 ballistic missile tests and heavy water experiments, ultimately winning the race to create Earth's first atomic weapons. With these devices and their launching mechanisms complete, Hitler was victorious.
The evolution of this timeline ultimately resulted in the non-existence of the United Federation of Planets. This timeline was aborted when Spock and Kirk, following McCoy, prevented the doctor from saving her. (TOS: "The City on the Edge of Forever")
In Gene Roddenberry's original story for TOS: "The Savage Curtain", Hitler was among the historical people recreated by the Excalbians to fight as the "evil" team opposing Kirk and the people representing the "good" ideals. (These Are the Voyages: TOS Season Three)
For some inexplicable reason, the Star Trek Encyclopedia (4th ed., vol. 1, p. 338) spelled Hitler's first name as "Adolph".