An atom is made up of protons, electrons and neutrons. The mass of an atom is found in the nucleus, since the neutrons and protons each weigh considerably more than the electrons orbiting it. The electrons can be removed or shared with other atoms without having a great impact on the mass of a chemical, and therefore it is through movement of electrons that chemical reactions take place. Of course, electrons could just happily spin off and completely leave the atom - it's not like they're part of the nucleus. However, the positive charge of the protons attracts the negatively charged electrons to it (since positive and negative charges attract each other). This keeps them spinning around the nucleus.
Atoms exist with a charge of '0' - that is, no more positive charge than negative. Fortunately, electrons and protons have an equal and opposite charge - that is, protons with their charge of +1 are equally matched by charge (yet not by weight) by electrons, whose charge is -1. This means that an atom will have just as many electrons orbitting its nucleus as protons in that nucleus in order to have a neutral charge. In the case of hydrogen, with one proton, that means having one orbitting electron. However, for something like carbon, with 6, that means having six electrons. Obviously, when a chemical has a really high proton number, the electrons could get really disorganised, but fortunately they are organised into electron shells or energy levels.
An electron shell or energy level is basically part of the organisation of the electrons around a nucleus. The electron cloud which orbits the nucleus is made up of many shells, which give the electron configuration some kind of structure. The first energy level will take 2 electrons, the second will take 8, the third will take 8 or even more, and so on. It gets a little complicated, but essentially this is all that we need to know for now. The figures show how the shells are filled, then. Figure 1 depicts a completely empty atom - this would, for instance, be like a hydrogen ion. If a hydrogen loses its electron, the it is left as just a proton with a positive charge. It still has its nucleus, but no electrons in its outer shells. This is why a hydrogen ion will also be referred to as a proton.
Figure 2 shows what a normal hydrogen atom would be like - it has one electron in the inner energy level. This means it has one empty gap - one available space for an electron to come in to complete the shell. This means that hydrogen atom is not a particularly 'happy' atom - it wants its outer shell to be full. This could either mean losing its electron (leaving no electrons in the outer shell, or effectively a 'full' outer shell), or getting one more electron. Since both involve movement of 1 electron, hydrogen probably isn't that bothered, but with only a small positive nuclear charge (there is only one proton, so there isn't much positive charge there) there's little to attract another electron to it; it is likely to lose its electron instead. And this is what often happens; it loses an electron, forming the hydrogen ion shown in figure 1. Although this means it has a positive charge, the ion has an empty outer shell.
Figure 3 shows what a helium atom would be like - it has two electrons in the inner energy ring. When considering chemicals' electron configurations, it is best to think about what the outermost energy level is doing - that is, the outermost energy level which has electrons in it (the valence electrons). There's no point in considering what the fourth energy level is doing, because there's no electrons anywhere near that. The outermost energy level containing electrons here is the same as the innermost one - and it's full. This means the atom is 'happy' - it will happily exist as it is. This means helium is a relatively inert or unreactive.
Figure 4 shows what a carbon atom would be like - two electrons filling the inner ring, and then the next ring containing the remaining 4 electrons. The outermost energy level therefore contains four electrons, and four spaces. This means carbon isn't likely to lose or gain electrons in the same way as helium - it cannot create a full outer shell this way. Instead, it would rather share its electrons in a covalent bond. If it shares its four outer electrons with other chemicals, and has four shared with it, it will feel like it has 8 outer electrons, and therefore a full outer shell. This is why carbon usually forms covalent bonds, rather than losing or gaining electrons to form ionic bonds (bonds between ions).
Figure 5 shows what a fluorine atom would look like. It's got all of its spaces filled up to the last one on the second shell. This means that it simply needs one more electron to get a full sublevel and be 'happy'. This is why fluorine will often take an electron some something else. Giving it this extra -1 charge will give the overall atom a charge of -1, turning it into an ion. Fluorine, then, often forms ionic bonds.
Fluorine (right and lower right) has a virtually full outer shell, so it wants one more electron to make it complete. It attracts this extra electron with the positive charge in its nucleus. The reason that another chemical - such as carbon (lower left) - doesn't attract the four electrons it needs to complete its outer shell is because it has fewer protons in its nucleus - six instead of nine. Carbon's outermost electrons are in the second shell, and fluorine's outermost electrons are also in the second shell - this means they are a similar distance from the nucleus.
However, because fluorine has a bigger nucleus, with more protons in it, it will be more likely to attract electrons into the second shell than carbon.
It will also attract the electrons it actually has, and pull them in a little bit more than carbon - this means that a fluorine atom is slightly smaller than a carbon atom. The way in which fluorine has a big nuclear charge (i.e. large number of protons) compared to the number of shells it has causes it to have a high electronegativity.
If an atom wants to lose an electron, the electron will be torn between whatever wants to steal it, and it's native atom. The native atom will attract it with the positive charge from the nucleus. Say the atom is like the one shown on the right (which represents the configuration of sodium). The outermost electron is on its own, so it's more likely to be lost than for seven more to be gained. However, there are also eleven protons in the nucleus attracting this electron. Why would it ever leave, then? Well, firstly, the diagram isn't very accurate - the shells look like they're really close, but actually there's a huge gap between each one.
Secondly, there is something called shielding. This basically means that the effect of the protons on the electron is reduced. There are loads of electrons - 10, in fact - between the outermost electron and the nucleus. Each one of those electrons has a negative charge; effectively, these electrons will 'absorb some of the positiveness' of the nucleus. This isn't exactly what they do, but because they are all in the way of this outermost electron, it doesn't feel as strong an attraction to the nucleus, and therefore can be lost.
(Remember that the positive attraction is not 'emitted' or delivered in pulses, as shown in the animations; this is simply displayed in this way to convey the idea of electron interaction with the positively charged nucleus.)
Also known as an electron subshell, it is basically where the electron shells of an atom are split up into smaller parts. It might sound like it's over complicating things, but it does have an affect. Basically the shells are split up into s. p, d and f (and g and h!). The s-sublevel can potentially hold 2 electrons, the p-sublevel can contain 6, d can contain 10 and f can contain 14! The order of filling isn't so simple, either. The innermost shell holds 2 electrons - it is made up of an s-sublevel, called 1s. If, as in a hydrogen atom, this sublevel contains only 1 electron (i.e. is not full) it is expressed as an electron configuration of 1s1. Helium would therefore be 1s2. The second shell contains 8 electrons - an s-sublevel and a p-sublevel. Each sublevel is filled before going on to the next one - so carbon is 1s2 2s2 2p2. Eventually this gets quite complicated - and boring! Endlessly writing out the whole configuration is often irrelevant, too, since it's only the outer electrons we're interested in. Instead, then, the earlier sublevels are replaced with the most recent 'noble gas'. The noble gases are the elements in the column furthest to the right of the periodic table, and have their outer shells complete, so they are useful to use. Therefore carbon uses the 1s2 from the helium, and becomes [He] 2s2 2p2. This might not seem like such a saving, but when it comes to something like Uranium, it is much easier to write [Rn] 5f3 6d1 7s2 than 1s22s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 6s2 6p6!!!
Within a given sublevel, electrons can either go around in pairs, or go around together. If they are in a particular sublevel, they will follow a particular shape around the nucleus - those in an s-sublevel will follow the s-orbital, a circular route around the nucleus.
Those in the p-sublevel will follow the p-orbital, a figure-of-eight type orbit, as shown. However, they don't necessarily follow the same route. If the electrons go around in pairs, they don't actually go 'hand in hand', but they will follow not only the same shape, but the same route around the nucleus. They obviously have to go in different directions - they follow a different spin. This is represented as a down arrow (down-spin) or an up arrow (up-spin), and will fill out boxes depending on the sublevel. If two electrons are paired, one box will have a down arrow and an up arrow next to each other. So how do we know if they are paired or not?
The sublevels are filled up by something called Hund's Rule - electrons will occupy a different orbital, or a given sub-level with spins in the same direction before pairing occurs. This means that, as shown in the animation, each sublevel is filled before moving onto the next one, and within each sublevel, the orbitals are all used before pairing occurs. The s-sublevel has only one orbital - for its 2 electrons to follow as a pair. The p-sublevel, with 6 electrons, has 3 orbitals (the same shape, but different orientations around the nucleus) - one for each of its pairs of electrons.