Sulfur has 6 valence electrons
The elements in row 3 up to sulfur are: sodium, magnesium, aluminum, silicon, phosphorus and sulfur. Since there are 6 of them, sulfur has 6 valence electrons.
Remember that valence electrons are the electrons in the outer shell of an atom.
Each row in the periodic table has 8 elements, just like each element can have a maximum of 8 elements in one shell (except for the first shell, which can only have 2 electrons, just like the first row only has 2 elements). So each row represents a full electron shell.
Each element has one more electron that the element to its left. Electrons are added until there are 8, then another shell is added. That's why the number of valence electrons corresponds to the number of elements in the element's row.