There is a simple criterion for such. If module $\rm\:M = [a,b\!+\!\sqrt{d}] = a\,\Bbb Z + (b\!+\!\sqrt{d})\,\Bbb Z\:$ is an ideal then it contains the norm $\rm\: N(b\!+\!\sqrt{d}) = (b\!+\!\sqrt{d})(b\!-\!\sqrt{d}) = b^2\!-\!d,\ $ so $\rm\,\ a\mid b^2\!-\!d.\:$ This necessary condition is also sufficient. The proof is easy:
The module $\rm\:M = [a,b\!+\!\sqrt{d}]\:$ is an ideal of $\rm\,R = \Bbb Z[\sqrt{d}]\iff$ M is closed under multiplcation by elements of $\rm\,R\iff$ $\rm\sqrt{d}\ M \subseteq M\iff a\sqrt{d},\, (b\!+\!\sqrt{d})\sqrt{d} \in M.\:$ The first inclusion is clear since $\rm\:a\sqrt{d}\, =\, a(b\!+\!\sqrt{d})-ab\in M.\:$ For the second inclusion
$$\ \ \ \ \begin{eqnarray}\rm -(b\!+\!\sqrt{d})\sqrt{d} &=\,&\rm (b\!+\!\sqrt{d})(b\!-\!\sqrt{d}\, -\,\color{#c00}b)\\[.2em]
&=\,&\rm\:\!\ b^2\!-d\, -\,\color{#c00}b(b\!+\!\sqrt{d})\end{eqnarray}$$
which lies in module $\rm\, M = [a,b\!+\!\sqrt{d}]\iff a\mid b^2\!-\!d = N(b\!+\!\sqrt{d})$.
The criterion generalizes to test idealness of the module $\rm\,[a,b\!+\!c\,\omega]\,$ in the ring of integers of a quadratic number field, e.g. see section 2.3 in Franz Lemmermeyer's notes.
This is a special case of module normal forms that generalize to higher degree number fields, e.g. see the discussion on Hermite and Smith normal forms in Henri Cohen's $ $ A Course in Computational Number Theory.