There's no known condition, and this isn't very well researched in the literature.

1. Monro, in his paper on Dedekind finite sets, constructs a model with a proper class of Dedekind finite sets, so AC and DC cannot be forced by a set forcing, but in that model we can do a class forcing and restore choice.

2. The Bristol model is locked between $L$ and $L[c]$, so it can be extended to a model of choice. It is not clear if this extension is a class forcing, and if so, is it definable in the model?

3. If you take Monro's model, or even the Bristol model, and you "do a Feferman-Levy" symmetric extension to make $\omega_1$ singular, then you can still extend to get choice, but you must collapse $\omega_1$.

4. In the Morris model, we cannot extend the model to a model of $\sf AC$ without adding ordinals because we have countable unions of countable sets that can be mapped on increasingly large sets. So, once we well-order everything, all cardinals must be below the continuum. Similarly in the Gitik model, everything has countable cofinality. This gives you an idea about necessary conditions. You need at least a proper class of regular cardinals. You need at least a bound on iterated power sets of sets that would have some fixed cardinality.

5. As a side curiosity, Cohen, Solovay, and ultimately Friedman, showed that if $M$ is a countable model of $\sf ZFC$ of height $\alpha$, it can be extended to a model of $\sf ZF$ of the same height which is uncountable. These models cannot be extended back to models of $\sf ZFC$ without collapsing cardinals *in the universe itself!* Since a countable height implies countable when $\sf ZFC$ holds in the model. 

----

Bibliography.

1. <cite authors="G. P. Monro">_G. P. Monro_, [**Independence results concerning Dedekind-finite sets**](https://dx.doi.org/10.1017/S1446788700023521). <i>J. Aust. Math. Soc., Ser. A</i> <b>19</b>, 35-46 (1975) ([ZBL0298.02066](https://zbmath.org/0298.02066)).</cite>

2. <cite authors="Asaf Karagila">_Asaf Karagila_, [**The Bristol model: an abyss called a Cohen real**](https://dx.doi.org/10.1142/S0219061318500083). <i>J. Math. Log.</i> <b>18</b> (2), Article ID 1850008, 37 p. (2018) ([ZBL1522.03215](https://zbmath.org/1522.03215), [arXiv:1704.06939](https://arxiv.org/abs/1704.06939)).</cite>

3. <cite authors="Asaf Karagila">_Asaf Karagila_, [**The Morris model**](https://dx.doi.org/10.1090/proc/14770). <i>Proc. Am. Math. Soc.</i> <b>148</b> (3), 1311-1323 (2020) ([ZBL1477.03212](https://zbmath.org/1477.03212), [arXiv:1811.10977](https://arxiv.org/abs/1811.10977)).</cite>