Look at the periodic table, and the number of valence electrons is identical to the number of group the element is in.
If you have only atomic number, you can write its electronis configuration and count the number of electrons on the outer shell
Here is a quick way to determine the number of valence electrons in a shell. It's been a long time since I studied this but thank goodness for online experts. Go to the below page. It has your answer.
Take Care! Dezzy.