As we increase the number of protons, the number of electrons also increases.

As we start to get more and more negative electrons around the nucleus, they will start to repel each other (Electrons have the same charge, and remember that same charges repel). For this reason, the electrons that orbit the nucleus cannot be all bunched together. Like the protons in the nucleus they need to be kept apart. So electrons orbit the nucleus at different distances, forming layers or 'shells' of electrons. This is a little bit like the planets orbiting the sun.

In lithium, the 3 electrons are in shells: two in the first, and one in the second shell.

The first shell can hold 2 electrons before it is full, the bigger second shell can hold up to 8, the third shell up to 18. Because we know the maximum number of electrons in each shell, we can accurately draw the atomic structure of Oxygen (lets think of the nucleus as one blob in this diagram rather than drawing all the protons and neutrons).


Protons
Neutrons
Electrons
Element Name
8
8
8
Oxygen

Oxygen has 8 protons, therefore it must have 8 electrons. We know that 2 of these electrons can fit into the first shell, and the remaining 6 go into the second shell (which can hold 8).