The general criterion is that no number can be found with more than one valid, distinct factorization. This might sound like I'm merely rephrasing the question, but it's actually a reframing of the question.
Plenty of numbers (infinitely many, to be precise) in $\mathbb{Z}[\sqrt{-5}]$ have more than one factorization. $6$ is just the easiest to find. To oversimplify matters, your main concern is with the "natural" primes from 2 to $p < 4|d|$ or $p \leq d$ as needed.
Now, the case of $\mathbb{Z}[\sqrt{2}]$ is actually more complicated than you might realize. Part of the complication is that $\sqrt{2}$ is a real number and so $\mathbb{Z}[\sqrt{2}]$ has infinitely many units. This sets up the trap of infinitely many factorizations that are not distinct because they involve multiplication by units, e.g., $$7 = (3 - \sqrt{2})(3 + \sqrt{2}) = (-1)(1 - 2\sqrt{2})(1 + 2\sqrt{2}) = (5 - 3\sqrt{2})(5 + 3\sqrt{2}) = \ldots$$
But $7$ really does have only one distinct factorization in $\mathbb{Z}[\sqrt{2}]$, as you can see by dividing these numbers by $1 + \sqrt{2}$, and $\mathbb{Z}[\sqrt{2}]$ really is a UFD. But the full explanation may require me to make several assumptions about what you know.
Let's look at a "simpler" domain, $\mathbb{Z}[\sqrt{10}]$, though it certainly has some of the same traps as $\mathbb{Z}[\sqrt{2}]$: $$31 = (-1)(3 - 2\sqrt{10})(3 + 2\sqrt{10}) = (11 - 3\sqrt{10})(11 + 3\sqrt{10}) = (-1)(63 - 20\sqrt{10})(63 \ldots$$
You have to look at numbers that are already composite in $\mathbb{Z}$ to begin with. And if $d = pq$, where $p$ and $q$ are distinct primes, the choice of where to look first is obvious: $$10 = 2 \times 5 = (\sqrt{10})^2.$$
Verify that $$\frac{\sqrt{10}}{2} \not\in \mathbb{Z}[\sqrt{10}], \frac{\sqrt{10}}{5} \not\in \mathbb{Z}[\sqrt{10}], \frac{2}{\sqrt{10}} \not\in \mathbb{Z}[\sqrt{10}], \frac{5}{\sqrt{10}} \not\in \mathbb{Z}[\sqrt{10}].$$ This means that $\mathbb{Z}[\sqrt{10}]$ is not UFD and we didn't need to compute any logarithms or sines to come to this conclusion. (You're starting to see why integral closure matters in making these determinations, right?)
Contrast $\mathbb{Z}[\sqrt{6}]$: $$6 = (2 - \sqrt{6})(2 + \sqrt{6})(3 - \sqrt{6})(3 + \sqrt{6}) = (\sqrt{6})^2$$ but $$\frac{\sqrt{6}}{2 + \sqrt{6}} = 3 - \sqrt{6}$$ and so on and so forth. This means that $6 = (\sqrt{6})^2$ is an incomplete factorization, just as, say, $81 = 9^2$ is in $\mathbb{Z}$. But this is not enough to prove that $\mathbb{Z}[\sqrt{6}]$ is or is not UFD.
As it turns out, both $\mathbb{Z}[\sqrt{2}]$ and $\mathbb{Z}[\sqrt{6}]$ are UFDs, and what is probably the simplest, most common way of proving this requires a full understanding of ideals. Adapting the proof that $\mathbb{Z}$ is a UFD to these domains can be done, but that has its own pitfalls.
Thanks for the comments. I believe I now have a complete answer to this question.
Claim.
Let $R$ be a UFD and suppose $I\subseteq R$ is a nonprincipal ideal. The ideal class $[I]$ contains a unique representative $J$ such that $[I]=\{(a)J:a\in R\setminus 0\}$.
The above claim shows that for a UFD, factorization of ideal classes is no worse than factorization of ideals. I will outline a proof of this below which aims to be elementary. $R$ is a UFD throughout.
Corollary.
Let $\mathcal{I}(R)$ denote the ideal class monoid of a UFD $R$, and let $\mathcal{I}$ denote the monoid of ideals $I\subseteq R$ such that $I$ is not contained in a proper principal ideal. Then $\mathcal{I}(R)\cong\mathcal{I}$.
Proposition 1.
Let $I$ be an ideal and $a\in R$. Then $I\subseteq (a)$ if and only if $I=(a)J$ for some ideal $J$.
Proof.
If $I\subseteq (a)$, then any $i\in I$ can be written as $ra$ for some $r\in R$. Let $J=\{r\in R: ra\in I\}$. Claim 1: $J$ is an ideal. Claim 2: $I=(a)J$. Conversely, $I=(a)J\subseteq (a)$.
Proposition 2.
Let $I\subseteq R$ be an ideal. Then there exists $a\in R$ such that $I=(a)J$, where $J$ is an ideal not contained in any proper principal ideal, i.e. whenever $J=(b)K$ for some ideal $K$, it must be that $(b)=(1)$.
Proof.
Let $i\in I$ and factor $i$ into (nonassociate) primes: $i={p_1}^{k_1}\cdots {p_n}^{k_n}$. For each prime $p_j$, factor out the largest possible power of $(p_j)$ from $I$. This yields $I=(p_1)^{l_1}\cdots(p_n)^{l_n}J$ for some ideal $J$, with $0\leq l_j\leq k_j$. Let $a={p_1}^{l_1}\cdots {p_n}^{l_n}$. If $J=(b)K$, then $i=abk$ for some $k\in K$. Therefore $b$ must factor into a product of $p_1,\dots,p_n$. Since the $l_j$ were chosen as large as possible, $(b)=(1)$.
Proposition 3.
The ideal $J$ as above is unique, i.e.\ if $I=(a)J=(b)K$, where neither $J$ nor $K$ is contained in a proper principal ideal, then $J=K$.
Proof.
Suppose $I=(a)J=(b)K$, with $a={p_1}^{l_1}\cdots {p_n}^{l_n}$ as above. Consider the localization $R_{p_1}$ of $R$ at $(p_1)$. By hypothesis, $J$ and $K$ are not contained in $(p_1)$, so this equation pushes forward to $(p_1)^{l_1} R_{p_1} = (b) R_{p_1}$. Thus ${p_1}^{l_1}$ divides $(b)$. Continuing in this way, each ${p_i}^{l_i}$ divides $b$. Similarly, all of the prime factors of $(b)$ (with multiplicity) must divide $(a)$, i.e. $(a)=(b)$. Then $(a)J=(a)K$ implies $J=K$.
This finishes the proof of the original Claim. The Proposition below shows that if $I$ and $J$ are not contained in a proper principal ideal, then $IJ$ also has this property. Thus the monoid $\mathcal{I}$ defined in the Corollary is closed under multiplication.
Proposition 4.
The ideal class monoid of a UFD contains no nontrivial inverses.
Proof.
Let $I$ and $J$ be nonprincipal ideals. We need to show that $IJ$ is not principal. By the above discussion, we may assume that $I$ and $J$ are not contained in any proper principal ideal (if they are, just replace $I$ and $J$ with the unique representatives of their ideal classes which have this property).
Suppose that $IJ=(a)$ is principal. $IJ\subseteq I$, so $(a)\neq(1)$. Then $a$ has a prime factor $p$. $IJ=(a)\subseteq(p)$ implies that $IJ R_p\neq R_p$. Since $I$ and $J$ are not contained in $(p)$, there exists some $i\in I\setminus (p)$ and $j\in J\setminus (p)$. However, the complement of a prime ideal is multiplicatively closed, so $ij\in IJ\setminus (p)$. Thus $IJ R_p = R_p$, a contradiction.
For completeness I'm also including a simple proof that maximal ideals in $\mathbb{Z}[t,t^{-1}]$ are not principal: the only quotient fields of $\mathbb{Z}[t,t^{-1}]$ are of the form $\mathbb{Z}_p[t,t^{-1}]/(f(t))\cong\mathbb{Z}[t,t^{-1}]/(p,f(t))$, where $p\in\mathbb{Z}$ is prime and $f(t)$ is irreducible mod $p$. In particular, these fields are finite. However, the quotient of $\mathbb{Z}[t,t^{-1}]$ by any principal ideal $(a)$ must be infinite (or zero, in which case $(a)=(1)$ is not maximal): if $a\in \mathbb{Z}$, then $\mathbb{Z}[t,t^{-1}]/(a)\cong\mathbb{Z}_a[t,t^{-1}]$ has polynomials of arbitrary degree, and if $a=a(t)$ is a polynomial of positive degree, then $\mathbb{Z}[t,t^{-1}]/(a(t))$ has $\mathbb{Z}$ as a subring. In conclusion, the maximal ideals are of the form $(p,f(t))$ as above and all require two generators. As height 1 primes are principal in a UFD, the maximal ideals are the only nonprincipal prime ideals in $\mathbb{Z}[t,t^{-1}]$.
This answers my original question about the ideals in a given ideal class. One can use these techniques to show that the submonoid generated by any nonprincipal ideal in a UFD is free (isomorphic to $\mathbb{N}$), and that the maximal ideals in $\mathbb{Z}[t,t^{-1}]$ generate a free submonoid of infinite rank (isomorphic to $\mathbb{N}^\infty$), for instance.
For an example of non-unique factorization of ideals/ideal classes, the following example I found in Multiplicative Ideal Theory by Giller has been illuminating for me: $(a,b)^2(a,b)=(a,b)^3=(a^3,a^2b,ab^2,b^3)=(a^2,b^2)(a,b)$, but one does not usually expect $(a,b)^2=(a^2,b^2)$. Taking $(a,b)$ to be a maximal ideal in $\mathbb{Z}[t,t^{-1}]$, e.g. $(2,t+1)$, we have $(2,t+1)^2(2,t+1)=(4,(t+1)^2)(2,t+1)$, but $(2,t+1)^2\neq(4,(t+1)^2)$. So this is an example of failure of cancellation of ideals, and it arises so naturally that one suspects this must be a common occurrence. Since neither ideal is contained in a proper principal ideal, this also displays failure of cancellation in the ideal class monoid, which corresponds to the classes $[(2,t+1)^2]$ and $[(4,(t+1)^2)]$ becoming identified in the group completion of the ideal class monoid.
Best Answer
Uniqueness of factorization up to associates means that if $r\in R$, nonzero and not a unit, is written as $$ r = p_1p_2\dots p_m = q_1q_2\dots q_n $$ with $p_i$ and $q_j$ irreducible, then
Two elements $a$ and $b$ are associate if there is a unit $u$ with $b=ua$.
This happens also in the integers: for instance, $6=2\cdot3=(-3)(-2)$.
In your case, $2+i$ is associate to $-1+2i$ and $1+i$ is associate to $1-i$.