Life imprisonment was a type of imprisonment where an individual convicted of a crime was sentenced to spend the rest of their natural lives in prison unless otherwise paroled.
By the mid 23rd century within the Federation the death penalty had been eliminated except for one thing - visiting Talos IV in violation of General Order 7, leaving life imprisonment as the most severe sentence the Federation could impose. (TOS episodes: "The Menagerie", "Turnabout Intruder") Within the Federation a number of crimes were punishable by life imprisonment, including murder, treason, and mutiny.
In 2256, Starfleet Commander Michael Burnham was stripped of rank and given a sentence of life imprisonment after an attempted mutiny against Captain Philippa Georgiou. Captain Gabriel Lorca arranged for her release into his custody on the USS Discovery to help fight the Federation-Klingon War of 2256-2257. Due to her role in helping to end the war Burnham was pardoned and her rank restored in late 2257. (DSC episodes: "Battle at the Binary Stars", "Context Is For Kings", "Will You Take My Hand?")
The Bajoran resistance fighter Rizo was given a life sentence for his crimes in stealing antimatter intended for the Hannibal. As part of his sentence he helped convert a former Cardassian prison into a factory for manufacturing ship components so that convicts could contribute to the recovery of Bajor following the Occupation of Bajor by the Cardassians. (DS9 novel: Antimatter)
Thomas Riker was sentenced to life imprisonment by the Cardassian government for his actions against the Cardassian government. (DS9 episode: "Defiant") He was later freed from captivity by Sela as part of a plot to assassinate Gowron and unleash a biological weapon on Qo'noS but did not carry out the plans and instead went underground. (TNG novel: Triangle: Imzadi II) By 2382 it had been believed he had died in Cardassian captivity during the Dominion War but had survived and been recruited into a Starfleet black ops team. (TTN novel: Fallen Gods; TTN - The Fall novel: The Poisoned Chalice)
Former Presidential Chief of Staff Galif jav Velk was given a sentence of life imprisonment for the numerous crimes he committed in helping Baras Rodirya assassinate Nanietta Bacco and seize the office of President in 2385. Due to his cooperation he was allowed to serve that life sentence at the New Zealand Penal Settlement instead of a high security penal colony. (ST - The Fall novel: Peaceable Kingdoms)