Valency of an element is a measure of its combining power with other atoms when it forms chemical compounds or molecules. The electrons present in the outermost shell are called valence electrons. Carbon has four valence electrons and here a valence of carbon is four.
Electronic configuration of carbon is,
C (Z = 6) = 1s2 2s2 2p2 = [He] 2s2 2p2