Warning: SPOILERS for Top Gun: Maverick
After his heroic performance in Top Gun graduates to find out who is "the best of the best." Maverick also leads the ace pilots, including Rooster (Miles Teller), the son of his late partner Goose (Anthony Edwards), on a dangerous mission to destroy a secret underground uranium plant.
Top Gun: Maverick gives a lot of exposition as to the state of Captain Mitchell's Navy career in the three decades since the original Top Gun ended. When Top Gun: Maverick begins, Maverick is a test pilot for the Darkstar scramjet program, and he becomes "the fastest man alive" by achieving an unheard-of Mach 10.4 velocity. But his stunt nearly gets him kicked out of the Navy before his "guardian angel," iral Tom "Iceman" Kazansky (Val Kilmer) saves Maverick by sending him to instruct at Top Gun. We learn that Maverick's previous stint as a teacher at Top Gun in the 1980s lasted only 2 months before he was kicked out. Maverick's insistence on following his instincts and remaining a pilot prevented him from being promoted above the rank of Captain. His heroics in a cockpit aside, Maverick's repeated insubordination - such as taking his girlfriend, Penny Benjamin (Jennifer Connelly) on a joyride in an F-18 - would have gotten him court marshaled were it not for Iceman rescuing him each time.
At the end of Top Gun: Maverick, it's not clear if Captain Mitchell has technically retired but he's "out" of Top Gun, and Pete is at peace with that. Top Gun pilots home kept him from getting court marshaled and earned grudging respect from Cyclone, but it's doubtful that it's enough to keep him flying for the Navy.
Maverick knew the writing was on the wall for his Navy career when Iceman died. Pete was well-aware that it was iral Kazansky's loyalty and friendship that was the lifeline of his Navy career because regardless of his commendations, Maverick's superior officers loathed his methods and considered him a liability and a "relic." Rear iral Chester "Hammer" Cain (Ed Harris) also intends to replace pilots with drones so Maverick's days as a fighter pilot were already numbered. Yet Captain Mitchell was able to recapture his past glory and prove he has skills no drone could ever duplicate or equal in Top Gun: Maverick. But Maverick's career as a test pilot is also kaput after his Mach 10.4 stunt destroyed the hypersonic Darkstar scramjet.
So, while Top Gun: Maverick didn't make it official, in part to preserve the potential for a third Top Gun movie and also to maintain the euphoria of the film's happy ending, Maverick is no longer officially a Navy pilot at the end of the film but he's fine with it. Still, it doesn't necessarily mean that Maverick formally retired his wings and, if there is a Top Gun 3, it would be a simple matter for Maverick to be called back into action once more. The point of Top Gun: Maverick's uplifting final moments of Maverick taking Penny up in his restored P-51 Mustang after reconciling with Rooster is that Maverick doesn't need the Navy to keep flying. But Captain Mitchell also proved "the Navy needs Maverick" after all, and Maverick would likely get back in the cockpit again if the Navy called.