The calculation is described in detail in the Wikipedia article on recombination.
If you consider the ionisation of hydrogen as a reaction:
$$ p + e \rightarrow H + \gamma $$
Then you can write down an expression for the equilibrium constant as a function of temperature using the Saha equation:
$$ \frac{n_pn_e}{n_H} = \left( \frac{m_ek_BT}{2\pi\hbar^2} \right)^{3/2} \exp \left( \frac{-E_I}{k_BT} \right) $$
If you take 50% ionisation you can work out the corresponding temperature and it turns out to be about 4,000K. So now it's just a matter of relating the temperature of the universe to the time after the Big Bang. Once we're past the various phase transitions that happened in the first few instants after the Big Bang the temperature is inversely proportional to the scale factor. Sadly there isn't a simple equation to give the scale factor as a function of time, however it's a straightforward numerical calculation, and the result is that the temperature was 4,000K about 380,000 years after the Big Bang.
That's how the figure of 380,000 years is calculated.