The maximum number of electrons that can be in an atom's valence shell is 8 electrons. This is according to the octet rule, which states that atoms tend to combine in such a way that they each have eight electrons in their valence shells, giving them the same electronic configuration as a noble gas. The valence shell is the outermost shell of an atom, and having eight electrons in this shell gives the atom a particularly stable arrangement.
The octet rule is a simple chemical rule of thumb that is applicable to most elements, especially carbon, nitrogen, oxygen, and the halogens, but there are exceptions to the rule, including hydrogen (which can only hold 2 electrons in its valence shell), helium (which also holds only 2 electrons), as well as elements involved in expanded octets. However, when speaking about the maximum number of electrons in the valence shell under the octet rule, the answer is 8 electrons.