For neutral atoms, the number of valence electrons is equal to the atom's main group number. The main group number for an element can be found from its column on the periodic table. For example, carbon is in group 4 and has 4 valence electrons. Oxygen is in group 6 and has 6 valence electrons.
Determine which group the element is in, and that will be however many valence electrons there are. Such as group one has one valence electron, group two has two valence electrons, group three has three valence electrons and so on.
Hope this helps!