In a covalent bond, the electrons are shared equally between the atoms. This type of bond is typically formed between atoms with similar electronegativities. In an ionic bond, one atom donates electrons to the other atom. This type of bond is typically formed between atoms with a large difference in electronegativity.
The sharing of electrons between atoms falls on a continuum from covalent bonds to ionic bonds. This means that there are many different types of bonds that exist between these two extremes. The type of bond that forms in a particular case depends on the electronegativities of the atoms involved.