The difference between a cation and an anion is that a cation is an ion with a positive charge, and an anion is an ion with a negative charge. Ions occur because many atoms, though their charge is zero, have electrons they wish to give up or have electrons they wish to steal from other atoms.
Most normal atoms don't have a charge because they have an equal number of protons and electrons. Protons, which are found in the atom's nucleus, have a positive charge, while electrons, which are found in a sort of cloud orbiting the nucleus, have a negative charge. Therefore, the positive and negative charges in an atom add up to zero.
The outermost shells of both chlorine and sodium are incomplete. The outer shell of sodium would be empty save one electron. The outer shell of chlorine would be full, but it lacks one electron. When sodium gives its electron to chlorine to create table salt, it becomes an ion with a positive charge, or a cation. This is because it now has more protons than electrons. On the other hand, chlorine, which grabbed the electron from sodium, now has a negative charge, because it has more electrons than protons. This makes it an anion.