Codon is a triplet made up of three-nucleotide sequences.
A codon is part of a gene that codes for a single amino acid.
Polymers of amino acids make up a polypeptide chain (protein).
Whereas a gene is a sequence of multiple nucleotide sequences which synthesizes a whole protein.
Hence, a codon is a part of a gene whereas a gene contains many codons in a specific sequence, which directs the sequence of amino acids present in a polypeptide chain.
For example, the AUG codon codes for the amino acid methionine.