I think the most important thing here is to point out some details which I don't believe get emphasized enough in chemistry classes, and yet are extremely important in approaching questions like this.
I mean why not 7 or 5 or 10 electrons? Why specifically 8?
I've been in this situation before. The one where I'm asking a question which I believe to be a question about the fundamental nature of matter, but the more I explore it, it just seems to be a meaningless question. The actual number of electrons required to stabilize a system is not a question we should really care about. The question we care about is whether or not our theories can predict that number. After all, in science, we are asking nature the questions, and nature gives us the answers. So in this case, nature has told us 8 electrons, so the answer is 8 electrons. I think that's one thing which is emphasized a lot more in physics than in chemistry. Nature is the arbiter. We simply try to rationalize the arbiter's decisions.
Why do atoms need 8 electrons to stabilize?
Now that's a question which can be answered by a theory! This can be answered in lots of detail or a little detail, but I get the feeling you are going to ask questions about why we don't just keep filling up the orbitals with more electrons? This is basically what you're asking about A.K.'s answer when saying,
what do you mean by energetically satisfied? How can an atom know if it is satisfied?
This leads us to perhaps the greatest disservice done to chemistry students in their classes: the habit of personifying chemical systems. Talking about the "desires" of the system makes it easier to understand when first learning, but this ought to quickly be abandoned (fluorine just loves electrons!). The answer to your question here is that the system doesn't know what it wants, and that is often a very good question to ask! These sorts of questions can be very productive when studying something like quantum entanglement. But, for the matter at hand, something simpler suffices. Chemical systems are dynamic. They are changing in time by colliding with other molecules, vibrating, rotating, absorbing photons and emitting photons, and doing all these things at once! So then, what it means for a system to be "energetically satisfied" is that all these things have found some kind of balance. It is perfectly possible that at any given moment some atom might lose an electron and another one picks it up, but again we must come back to what nature tells us. Nature says that when we have two atoms flying around, and one of them has seven electrons, that atom is going to take an electron from something else.
This need not be reserved for chemical systems though. In all of physics, we observe that systems tend towards their lowest energy state. This isn't dictated absolutely by some law, but rather it is a general rule. After all, we can find systems that aren't at the global minimum of their potential energy surface, but if the activation energy can be ignored, we will almost always find that system in its lowest energy state.
It's almost as if nature is probing these five, seven, and ten electrons states which you suggest, but simply does not stay there because that is not the way the world works. To be technical, systems tend towards equilibrium (you must convince yourself of this because the mathematics to show it can be involved), so when I find an atom with ten electrons, the forces in the system are out of balance. There might be eight positive charges in the nucleus, but ten negatively charged electrons. Thus, when something with seven electrons comes around, it is likely that system will take one of the extra electrons because this balances out the forces (as well as can be done in this example). Some kind of equilibrium has been established. This is obviously a simplistic example, but you could imagine then that if you had an ensemble of Avogadro's number of particles, that all these things would be exchanging their imbalances and staying around the equilibrium. This equilibrium, again, is observed to be the low energy state.
If and when you ever study quantum mechanics, you'll find that these things all arise quite naturally out of the theoretical framework laid there. When you find that angular momentum is quantized (and that the electron can have zero angular momentum), you naturally ask what this waving electron thing looks like (say 95% of the time). So, you plot this using the equations that you've found from your theory, and you get out the orbitals that we learn all about in chemistry classes. The next question leads into what you're asking here, both about the number of electrons each atom will naturally have around it, and about the relative stability of each of those cases. If you really want to be satisfied about those questions, study quantum mechanics. Otherwise, what we've said here ought to suffice. All in all, there comes a point when you either to need to look deeper, and be willing to grapple with some complicated ideas in quantum mechanics, or you need to give up on asking epistemological questions because the answer to those kinds of questions in science is almost always, "because mother nature says so."