A stop codon is a nucleotide triplet within mRNA that signals the termination of protein synthesis during translation. It does not code for any amino acid and serves as a crucial signal for the ribosome to release the newly formed polypeptide chain. The presence of stop codons ensures that proteins are synthesized to their correct lengths, preventing the addition of extra, unnecessary amino acids.