Retirement was a period in an individual's life which followed the cessation, partial or complete, of that individual's primary career.
In 2152, when the Vulcan ambassador Soval maneuvered to end the mission of Enterprise NX-01, Commander Charles Tucker III stated of him to Doctor Phlox, "They'll probably give the son of a bitch some gaudy medal and then cart him off to wherever they send bitter old Vulcans to retire." (ENT: "Shockwave")
In 2267, despite being a complete invalid, Fleet captain Christopher Pike was still on the Starfleet active duty list because nobody had the heart to retire him. Spock successfully exploited this to use Pike as one of the three required command level officers for his court martial for mutiny. (TOS: "The Menagerie, Part I")
In 2270, the Federation Starfleet had a policy of mandatory retirement set (for Humans) at age 75. When, in 2270, Commodore Robert April proved that he was still very much capable of commanding a starship at 75, Starfleet reviewed his appeal to have his retirement delayed. (TAS: "The Counter-Clock Incident") The policy was apparently rescinded by the time of the launch of the USS Enterprise-D, as Leonard McCoy was still a Starfleet admiral at age 137. (TNG: "Encounter at Farpoint")
Obsidian Order head Enabran Tain retired in 2368. He was the only Cardassian in that position to live long enough to be able to retire. Legate Porania was "speechless" when Tain told him. Although Tain chose to retire to Arawath Colony, he kept "informed" on current events. He came out of retirement to lead a joint Obsidian Order and Tal Shiar attack on the Founders. He had no intention of returning to retired life and wanted to return to his "old job" and his "old life". (DS9: "The Wire", "Improbable Cause", "The Die is Cast")
In the Julian Bashir, Secret Agent holoprogram, Bashir enlists the help of Nigel Dunlap, a retired secret agent, to stop Lady Wantsomore from assassinating the Queen of England. (DS9: "A Simple Investigation")
Benjamin Sisko planned to retire to his house in Bajor's Kendra Valley. Jake found it "weird" to hear his father talk of retirement. Sisko told him to bring his "grandkids to see me a few times a year". (DS9: "Penumbra")