Each element has had a number attached to it called the electronegativity of the element. The number measures the ease with which an electron is added to make it an ion. For example, F had an EN of 4.0 (its the most EN element in the table) so it attracts an electron VERY EASILY. On the other hand, Cs (group I) has an EN of about 0.8 (which means it has a LOW attraction for electrons---in fact it wants to give electrons away). So a combination of Cs and F would be 4.0 - 0.8 = 3.2 and ionic. (Cs is the most electropositive element in the table and F is the most electronegative element in the table. Shifting gears slightly, it may help if you know how EN was developed. Linus Pauling was a brilliant chemist who was able to put huge amounts of information together and devise scales from them. Placing a number by the element and calling that number the electronegativity of the element was Pauling's idea. He arbitrarily assigned 4.0 to F and the other numbers are a proportion of the 4.0 of F depending upon how their attraction for an element corresponds to that of the element F. From experiment, we know that CsF is an ionic crystal. Pauling looked at covalent compounds and ionic compounds and found that a difference of about 1.8 or so is about 50% ionic character and 50% covalent character. Pauling made his table SO THAT THE GREATEST DIFFERENCE IS MORE IONIC and the lesser difference is covalent. It stands to reason that H2 would be a covalent bond since both have the same EN and the difference is zero; therefore, that would be about as covalent as we can get. This is the same concept as atomic masses being compared to carbon 12.00 set at exactly 12.00. In the early days those early pioneers could not weigh an atom and there was no standard. So someone decided to use oxygen as the standard and call it 16. Unfortunately, two scales developed from that standard which led to confusion; therefore, the standard was changed about 1970 or so (I forget the exact year) and everyone now uses the C-12 standard. Same concept. We didn't know weights so we developed a scale relative to something else. Pauling didn't know how much elements attracted electrons so he developed a scale relative to F. I hope this helps your understand of EN.
Thanks! That helped a lot!
Dr. Bob's answer is very thorough. Two more cents' worth from an old chemistry teacher. I have been telling my students that electronegativity differences are very useful in comparing the polarity of covalent bonds. They are not very useful in distinguishing between ionic and covalent bonds. CF4 is not an ionic compound and the bonding in LiI is not covalent. Looking at the metal to nonmetal, and nonmetal to nonmetal combinations is a more reliable way to distinguish between ionic and molecular compounds. No apologies to textbook writers for blurring the difference between comparing compound types and comparing bond polarities.