For how long CMB was being emitted?

The answer depends on the adopted baryon/photon ratio, the time-dependence of temperature in the expanding universe and what you define to be the ionisation fractions at the beginning and end of the (re)combination epoch.

As the universe cools, first the helium ions recombine, followed by the hydrogen ions (protons).

The time to go from a hydrogen ionisation fraction of 90% to say 10% is around 70,000 years, with a central epoch of around 300,000 years, for the usual $\Lambda$CDM model and a baryon to photon ratio of $6\times 10^{-10}$.