In basic chemistry a covalent bond involves the equal sharing of a pair of electrons between two atoms, and an ionic bond has an electron transfered from one atom to another.
However this is an oversimplifaction: most of the time it's a bit of both. Take NaCl, an ionic compound, in typical theroy an electron is transfered from the Na atom to the Cl atom. What really happens through is that the electron is'nt complectely transfered to Cl. The electron is far closer to the Cl atom than the Na, but its still being shared... just unequally.
So how do you decide if a compound is ionic or covalent? Electronegativatity is a measurement of the affinity between a nucleus of an element and its electrons. Each element has a charecteristic electronegativity value between 0-4. If the difference in electronegativity is huge(greater than 1.7) the bond is considered ionic. With differences less than 1.7 the bond is considered covalent.
For our above example of NaCl, Na's value=0.93, Cl=3.16. The difference between them is 2.23, therfore the compound is ionic.
So what about hydrogen chloride: H's value=2.2 Cl's=3.16 . The difference in electronegativaty is 0.96. As this value is less than the value required to make it ionic, it must be covalent. However the electrons are not shared 100% equally- Cl is slightly more greedy, not greedy enough to be considered ionic, but enough to be considered polar.
See below link to find out more about electronegativaty and finding out the values for every element's electronegativity value.