The valence shell is the outermost (highest energy) shell in which a given atom has electrons. Electrons surround atomic nuclei in probability density patterns called orbitals. Lower energy orbitals are tighter around the nucleus; electrons are attracted to protons, so it takes less energy for them to maintain a short distance from the nucleus. The valence shell electrons are most likely to be used in a molecular bond because, being in the highest energy shell, they are least firmly held by the nucleus.

Electrons fill orbitals in an order easily determined from the following chart.

1s
2s 2p
3s 3p 3d
4s 4p 4d 4f
5s 5p 5d 5f
6s 6p 6d
7s 7p
8s

Draw lines through each top right-lower left diagonal, starting with 1s, to get the following order: 1s 2s 2p 3s 3p 4s 3d 4p 5s 4d 5p ...

The s orbitals hold 2 electrons each, the p's 6, the d's 10, the f's 14. Going past f is unnecessary; we can't make atoms that gargantuan.

Having placed all the atom's electrons, count back until you reach the beginning of an s orbital and you'll have the number of valence electrons.

Valence electrons don't really apply to atoms with d and f orbitals. They swap electrons around between orbitals of roughly equivalent energies. Working with them in this context can give you "the crazy" if you attempt it unprepared, but fear not, said preparation will eventually be provided.

Because you'll mostly only work with s and p orbitals, atoms will seem to follow an "octet rule" and attempt to share valence electrons in such a way as to have eight shared valence electrons, the sum of the number of electrons in an s and a p orbital pair.