How do we measure the total heat content contained in ocean and atmosphere?
The heat content of a substance is known as enthalpy.  The international convention used for the Thermodynamic Equation of Sea Water is maintained by the Joint Committee on the Properties of Seawater. 

Equations for calculating the thermodynamic variables of sea water, humid air and other substances are set forth in the Numerical implementation and oceanographic application of the thermodynamic potentials of liquid water, water vapour, ice, seawater and humid air – Part 1: Background and equations by R. Feistel, D. G. Wright,†, D. R. Jackett, K. Miyagawa, J. H. Reissmann, W. Wagner, U. Overhoff, C. Guder
,A. Feistel, and G. M. Marion. Enthalpy of sea water is discussed in section 4.3.   

One would need temperature, pressure and salinity information for each point in the ocean, and integrate specific enthalpy over the entire volume of the ocean.