In molecular docking, what is the difference between ligand and cofactor?
Ligand is an umbrella term for non-covalently bound anything. A cofactor, substrate, or allosteric regulator could be a ligand. This is a biochemical definition ligand, don't confuse it with a formal chemistry definition of ligand.

What's generally important about cofactors is they're not protein, but they're essential to the protein's biological activity. They could be a metal ion, organic complex, a vitamin, etc. Organic complexes that act as cofactors are also known as coenzymes. Cofactors that bind tightly or become covalently bound are called prosthetic groups. The protein without the required cofactors is called an apoenzyme, and with it's cofactors is called the holoenzyme.

Keep in mind to be on-topic for this site you need to do some research ahead of time and produce a focused, studied question. Wikipedia regularly provides the same answer verbatim!