Hydrogen molecule potential energy graph
Normally, when the atoms are separated by a huge amount (infinity) we take this energy to be zero. Bringing the atoms closer to one another has an attractive potential and the bond has formed on reaching the lowest point on your curve.  Moving the atoms closer together increases the potential energy because here we push electrons closer to one another and this energy increases rapidly  with each small decrease in separation due to repulsion of similar charges. The slope of the curve gives the force on the atoms, so at small separation they experience a large force and repel one another. At large separation, where the slope is positive, there is a smaller attractive force.