When two atoms come
very close, the force between them is always repulsive, because the electrons stay outside and the nuclei repel each other.
Unless both atoms are ions of the same charge (e.g., both negative) the forces between atoms is
always attractive at large internuclear distances r.
Since the force is repulsive at small r, and attractive at large r, there is a distance at which the force is zero. This is the equilibrium distance at which the atoms prefer to stay.
The interaction energy is the
potential energy between the atoms. It is negative if the atoms are bound and positive if they can move away from each other.
The interaction energy is the integral of the force over the separation distance, so these two quantities are directly related.
The interaction energy is a minimum at the equilibrium position. This value of the energy is called the bond energy,
Bond length is related to
bond order: when more
electrons participate in bond formation the bond is shorter.
Bond length is also inversely related to bond strength and the bond dissociation energy: all other things being equal, a stronger bond will be shorter.
In a bond between two identical atoms, half the bond distance is equal to the
covalent radius.
for details see
https://en.wikipedia.org/wiki/Bond_length