The carbon atom has atomic number 6. Atom number is equal to the number of protons in an atom. In a neutral atom the number of protons is equal to the number of electrons. So the carbon atom has a total of 6 electrons. The first shell of the C atom has 2 electrons and the second shell has 4 electrons. Since the second shell or outermost shell or the valence shell has 4 electrons the valency of carbon is 4.
Since the C atom has 12 particles in it nucleus, it has a mass number of 12. Mass number is the sum of the number of protons and neutrons. As we know C has 6 protons, there must be 6 neutrons in it.