WORF
11 to 14 ranks
Starfleet:
Ensign (DS9/TOS Crossover: "Trials and Tribulations")
Lieutenant (TNG episode: "Encounter at Farpoint")
Lieutenant Jr Grade (TNG episode: "Evolution")
Lieutenant Commander (TNG movie: Star Trek Generations)
Commander (DS9 episode: "Way of the Warrior")
Starfleet Parallel Universe:
Commander and First officer of the Enterprise-D (TNG: "Parallels")
Mirror Universe:
Regent (DS9: "The Emperor's New Cloak") (both political and military position, commanded flagship of the Alliance) Look under heading Mirror Universe: https://memory-alpha.fandom.com/wiki/Regent
Gowrons Klingon Defence Force:
Weapons Officer (TNG episode: "Redemption")
Captain Worf "...whom attained the rank of Captain (in Worf's case,
through the Klingon Defense Force) while under the command of Captain
Jean-Luc Picard." See paragraph under heading Captain:
https://memory-alpha.fandom.com/wiki/Starfleet_ranks
Klingon:
Commander and First Officer IKS Rotarran (DS9: "Soldiers of the
Empire")
Chancellor (DS9 episode: "Soldiers of the Empire") (The chancellor is both politically head of the high council and the military head of the Klingon Defense forces outranking all generals)
Other Possibilities:
If you include Ambassador(s):
Ambassador to Qonos (DS9 episode: "What you leave behind")
Starfleet TOS:
Colonel Worf of the Klingon Imperial Forces (Star Trek VI: The Undiscovered Country) (This is Worf's grandfather who is a
different entity, but so is a person in a parallel or mirror universe. He is
called Worf and has the same actor playing him)
Q's Universe
Squire (TNG episode: "Qpid") (A squire is a military rank, it is the second lowest rank just below becoming a knight) https://en.wikipedia.org/wiki/Squire
So anywhere from 11 to 14 depending on what you consider a rank. Clearly Starfleet, Parallel, Mirror Universe, Gowron's Defense Force, and Klingon would count. Colonel Worf you have to decide if he's the same character, since it is in name & actor, but not the same entity. Ambassador does have power and was a promotion from commander, but is not necessarily a rank. He was chancellor albeit for a brief moment before he gave the office over to Martok. Chancellor is head of the Klingon Defense Force and highest held military rank. Squire should also be considered. In the Robin hood episode he was Will Scarlet who in many Robin Hood stories is considered a squire.
Why I suggested you might think about including ambassador:
As high-ranking official representatives, Federation ambassadors have
powers to issue orders and special instructions to Starfleet starship
commanders. (TOS: "A Taste of Armageddon"; TNG: "The Host", "Data's
Day"; DS9: "The Adversary")
https://memory-alpha.fandom.com/wiki/Ambassador
Klingon Defense Forces Rank Emblems(added since people were questioning Worf holding various ranks in the Klingon Defencse forces):
The rank system of the Klingon Defense Force bears some resemblance to
various Earth ranking systems. A ceremonial sash of varying design and
material is worn by commanding Klingon warriors to show rank and
status in society. The sash can be made of many materials, most
commonly of gold thread or silver metal, such as those worn by Worf
and Martok. https://memory-alpha.fandom.com/wiki/Klingon_ranks
Klingon Defense Force Hierarchy:
The system of hierarchy aboard ships within the Defense Forces was
highly structured. According to one of their systems, one that
operated successfully for centuries, the first officer of any Klingon
vessel had the duty to assassinate his captain when and if the captain
became weak or unable to perform. It was expected that his honorable
retirement should be assisted by his "first". The second officer also
shared similar duties with his "first". (TNG: "A Matter Of Honor";
DS9: "Soldiers of the Empire")
https://memory-alpha.fandom.com/wiki/Klingon_Defense_Force
List of Klingon Defense Force Personnel:
WORF
https://memory-alpha.fandom.com/wiki/Klingon_Defense_Force_personnel
(As a side note Worf is working on a project to do a new Star Trek series(God please make it happen) called "Captain Worf." So if that happens then the answer would change to 12-15 ranks adding Starfleet Captain. Here's a link to an article on it from this year http://spinoff.comicbookresources.com/2015/06/11/with-fan-support-michael-dorn-hopes-captain-worf-will-be-star-treks-next-frontier/)