A Court-martial is a military court. These military courts can determine punishments for members of the military subject to military law who are found guilty of a crime or may dismiss the charges based on the evidence and the case presented. If found guilty a person can get off with a simple discharge or face time in a military prison. The correct plural is "courts-martial".
In 1998, Major Louis Ferretti was sent after SG-1, who went to the Stargate coordinates they obtained from an Alternate reality, to bring them back for a court-martial. (SG1: "Within the Serpent's Grasp")
In 2008, when Lt. Colonel John Sheppard led a rescue mission to Michael's cruiser to save Teyla Emmagan against orders. Before that, he told Colonel Samantha Carter she could court-martial him if he survived. (SGA: "Search and Rescue")