Martial law is the imposition of military control on a civilian population. This was most often done on a temporary basis during an emergency, or in an occupied territory during a state of wartime.
A curfew was often part of an imposition of martial law.
Following the destruction of most of the food supplies on Tarsus IV by an exotic fungus, the government of Tarsus IV implemented martial law. In the aftermath of the massacre, Starfleet relief forces and the colonial government maintained a state of martial law on the planet. (DSC novel: Drastic Measures)
Owing to manipulation by then Admiral James Leyton, Federation President Jaresh-Inyo declared martial law on Earth in 2372 in advanced of a supposed Dominion invasion. After Leyton's conspiracy was exposed, martial law was rescinded. (DS9 episode: "Homefront") The ease with which Jaresh-Inyo had been manipulated was a key factor in his losing re-election. (TNG novel: A Time to Kill; TNG - Slings and Arrows eBook: Enterprises of Great Pitch and Moment)