Call

carbon-12 and carbon-14 are of the same element, carbon.

this means that they have the same number of protons and the same number of electrons - just different numbers of neutrons

the numbers 12 and 14 show the of each isotope: the number of protons added to the number of neutrons.

meanwhile, the of an element is the number of protons, or the number of electrons, it has (since, in a stable atom, the number of protons and electrons are the same).

all isotopes of carbon atoms have $6$ electrons and $6$ protons, which is why the atomic number of carbon is $6$.

a carbon-12 atom has $6$ protons, $6$ neutrons, and $6$ electrons, so its mass number is $12$ and its atomic number is $6$.

a carbon-14 atom has $6$ protons, $8$ neutrons, and $6$ electrons, so its mass number is $14$ and its atomic number is $6$.