Here's a quick-and-dirty estimate.
The gravitational self-energy of a uniform-density sphere is
$$
U = \frac35 \frac{GM^2}R
$$
Let's assume Theia had the same mass and density as Mars, and that Gaia contained the rest of the mass of the Earth-Moon system.
The binding energies for the four bodies are then
theia/mars 4.82e+30 joules
gaia 1.90e+32 joules
earth 2.24e+32 joules
moon 1.24e+29 joules
You can see that Theia and the Moon contribute to the binding energy starting the third significant figure: moving the 90% of Theia's mass to Gaia, leaving us with the Earth and the Moon, must have released something like $0.3\times10^{32}\rm\,J$ of gravitational binding energy as heat.
Kinetic energies due to Earth's rotation and the Moon's orbit are irrelevant compared to Earth's binding energy --- the biggest contributor there is $0.25\times10^{30}\rm\,J$ associated with Earth's daily rotation.
It's probably safe to assume the same about the progenitors.
Apparently a teraton of TNT is $4\times10^{21}\rm\,J$, if you insist on that comparison.
Note that I've assumed nothing about the geometry of the collision, whether it was head-on or glancing. I'm only making assumptions about the (well-known) final state and the (poorly constrained) initial state.