How much energy is required to hold the earth’s atmosphere up against the forces of gravity?
I can not comment on whether your understanding about the formation of the atmosphere (your first paragraph) is correct. However, given that the complete atmosphere lied at the surface at some point, it is possible to calculate the amount of energy to lift this towards its current state. 

The calculations will be done for a small surface area of one meter squared and choosing values corresponding roughly to the global averages. 

First we calculate the gravitational potential energy of the atmospheric column as follows 

$$ E_{atmos} = m_{atmos} \cdot g \cdot h_{atmos}$$

with $h_{atmos}$ the height of the center of mass of the atmospheric column. Surface atmospheric pressure ($P_{surface}$) is the force resulting from the mass of the atmospheric column under gravitational acceleration. Therefore, the above can be rewritten as 

$$ E_{atmos} = P_{surface} \cdot h_{atmos}$$

The centre of mass at the atmosphere is approximately at $h_{atmos}$ = 5 km (one can look at maps of the 500 hPa geopotential heights for example). For surface pressure we can take the standard atmosphere (101325 Pa). Plugging in the numbers: 

$$ E_{atmos} = 101325\,Pa \cdot 5000\,m = 5.1e8\,N m^{-1} = 5.1e8\,J\,m{-2}$$

To get to the total energy, this number needs to be multiplied by the surface area of the earth. However, it is more insightful to get a certain timescale out of this value. We can calculate how long it would take for the sun to deliver this energy to the earth's surface.

$$ \tau_{sun} = \frac{E_{atmos}}{SI_{avg}}$$

With $SI_{avg}$ the global average incoming solar radiation (not taking into account atmospheric absorption). Plugging in the values

$$ \tau_{sun} = \frac{5.1e8\,J\,m{-2}}{340\,W\,m{-2}} = 1.5e6 s = 17.5 days$$

So it would take about 17-18 days for the sun in order to 'lift up' the atmosphere from the surface to its current height.