The type of bonding found in sodium chloride is called ionic bonding. Ionic bonding is the attraction between two atoms with opposite charges. In sodium chloride, sodium has a positive charge and chlorine has a negative charge; therefore, they attract one another and form a bond.
Sodium and chlorine, as neutral atoms, are not stable. Sodium contains one valence electron, and chlorine has seven. The octet rule states that atoms want to have an outer energy shell like that of the noble gases, which means that they need eight valence electrons. These eight electrons in the outermost energy level represent stability. Neither sodium nor chlorine has this noble gas structure, so they tend to lose or gain electrons to attain a more stable state. Sodium loses its single valence electron to chlorine and becomes a cation, a positively charged atom. Chlorine gains an electron and becomes an anion, a negatively charged atom. These two ions with opposite charges come together to form an ionic bond.