The amount of free electrons in the interstellar medium (ISM) depends on its temperature, the ambient radiation field, and the chemical composition of the gas. Hot gas ($T\sim10^6\,\mathrm{K}$) is completely ionized, warm gas ($T\sim10^4\,\mathrm{K}$) is typically partly ionized, while cold gas ($T\sim10^2\,\mathrm{K}$) is neutral.
The duration for a given electron in an ionized medium that it stays free, before meeting an electron-hungry ion, depends on the density $n_e$ of the electrons and the temperature (since a hotter gas means faster particles which recombine less easily). This temperature dependency is captured in the quantum mechanical "recombination coefficient" $\alpha_\mathrm{rec}(T)$.
At $T\sim10^4\,\mathrm{K}$, the recombination coefficient is roughly $3\times10^{-13}\,\mathrm{cm}^3\,\mathrm{s}^{-1}$, so for instance for a $n_e = 1\,\mathrm{cm}^{-3}$ gas, typical of the warm medium, the recombination timescale amounts to
$$
t_\mathrm{rec} = \frac{1}{n_e \alpha_\mathrm{rec}} \sim 3\times10^{12}\,\mathrm{s},
$$
or some 100,000 years.
Since the recombination coefficient decreases with $T$, and (more importantly) since the density also does, free electron stay free longer in hotter gas. Once an electron is captured, it may be "freed" again by a collision with a fast-moving particle, or by energetic radiation.