The oxidation number (or electronic charge) of an element is the number of electrons to be gained or lost in order to make the element electrically stable.
In nature, elements rarely exist as electrically neutral atoms. Atoms, however, are most stable when they have a filled valence shell. Remember, the valence shell is the outermost occupied energy level. Therefore, elements are found in their charged forms. To highlight this point, consider a neutral atom of calcium. Calcium has an oxidation number of positive 2 (+2). Calcium (and all other alkaline earth metals) lose two electrons to complete the valence shell. In chemistry, when a species loses electrons it adopts a positive charge. This is due to electrons carrying a negative charge. Therefore, the overall atom has a more positive charge. Now take a look at calcium once it has lost those two electrons and adopting a +2 charge. Notice that the atom has a completed valence shell and is therefore smaller in size.
Any oxidation number for the an element can be justified in this manner.