The number of valence electrons is important to know when determining the type of bond between atoms. This is because ionic bonds transfer electrons to fill in the electron shell. For example if we have a Na atom with 1 valence electron and a Cl atom with 7 valence electrons that 1 electron will transfer to Cl to fill the electron shell.
In contrast, Covalent bonds share electrons.
And Just a Tip: Covalent bonds are between two non-metals. Ionic bonds are between a non-metal and a metal.
Hope this helped(: