Hydrogen covalent bond
The energy on the y-axis is the total energy of the system. It uses a reference of E = 0 for when 2 H atoms are infinitely far apart.

As to why the plot looks the way it does...

When the H atoms are infinitely far apart, they are not interacting at all. When brought together, you get a covalent bond which forms. This can be treated at various levels - In the simple classical picture, the 2 electrons are "shared" between the two atoms, leading to lots of electron density in between the atoms, which the 2 protons are then attracted to, and this is what holds the 2 H atoms together. Now we have a slight problem - why do they stop? You could say due to the nuclear repulsions, but if you have a simple situation, using  $\ce {H2+}$:

$\ce{H+}$---e---$\ce{H+}$

With the electron just sat halfway between 2 nuclei. Now let's analyse this situation with just classical mechanics, all units set = 1 for convenience. q = Charge on electron and nucleus. d = Distance from nuclei to nuclei:

Force on each $\ce{H+}: $
$\ F = q^2/d^2 - q^2/(d/2)^2 =  -3q^2/d^2  $

We have $\ce{q^2/d^2}$ term for the repulsion between the 2 nuclei and the negative $\ce{-q^2/(d/2)^2}$ term is due to attraction between nucleus and electron. In this situation the covalent bond results in an attraction of both nuclei together for all values of d - IE eventually we get a singularity. This is why the covalent bond can only really be understood in a quantum mechanical framework.

Taking again the situation of $\ce{H2}$ but this time in a quantum mechanical way.

We start off with 2 hydrogen atoms infinitely far apart. They each have an electron in H 1s, with OPPOSITE spins. When they are brought closer together the wavefunctions change. Now what happens is this. The electron in H 1s of one atom is able to tunnel into the potential well of the other hydrogen atom. By doing this the total volume in which the electron resides is larger - Obviously the electron can go anywhere in the universe, as per usual QM, but the H atom is localised less. This leads to a decrease in the electron's kinetic energy - It is spread out more, and so uncertainty in position is larger, so uncertainty in momentum can be less, and so leads to a lower KE. The potential energy which the electron experiences won't change a huge amount - Yes there are 2 potential wells but it doesn't get closer to them. This is the story at first glance.

However there is the virial theorem which states:
$2KE+PE+R(dE/dR)=0$

So the decrease in KE by bringing 2 H atoms closer together must be balanced out somehow - Either an increase in KE by another means, or an increase in potential energy (PE). If we shrink the 1s orbitals contributing to the bond, this in turns increases KE and decreases PE - PE is negative, and so becomes more so. Thus we find the orbitals shrink in bonding. This all leads to a picture like this: 

As 2H atoms draw closer together, electron on one can tunnel onto the other. This leads to a decrease in KE, and as at the equilibrium bond distance $2KE+PE = 0$ this decrease in KE must be balanced out by a contraction in the H 1s orbitals contributing to the bond, leading to both a larger KE term and a more negative PE term. In other words a covalent bond forms because it reduces the kinetic energy of the contributing electrons and increases the potential they feel, due to the contraction of orbitals via the Virial Theorem pathway.

Now back to your plot. At far distances, E=0, because no interaction, and this is taken as 0 point - IE referenced relative to infinite separation. As 2 H atoms brought together, get interaction described as above. At around 2 bond lengths, the KE term reaches a minimum. It then rises - the 2H atoms are so close now that more overlap - IE more tunneling of electron from well to the other well - has no more effect. Instead the wavefunction of the electron is found to contract. This raises the KE term - electron now confined to a smaller space = Larger KE term - but the PE term becomes more negative by a larger amount. At the equilibrium bond length, the virial equation applies as written above:

$2KE+PE=0$ 

now applies. Thus the KE term is positive with value x, and the PE term is negative, with value 2x. Thus if 
$E=PE+KE$
we have a negative binding energy, as expected.

Interestingly the involvement of KE in bonding leads to a new class of bonds, called charge shift bonds - the prime example of which is difluorine, $\ce{F2}$. This molecule has an overall bond order of 1 according to MO theory, but has a large antibonding effect due to filling of antibonding pi orbitals. Calculations using VB theory indicate that the covalent contribution to the structure never actually has a minimum - IE antibonding at all distances. In this case adding in ionic structures is entirely responsible for the bond observed. 

This stackexchange answer explains it well, if you're interested, and there's a number of interesting papers listed there as well.

What is charge shift bonding?