Let $d\in\mathbb{Z}$ be an integer which is not a square (it does not have to be squarefree, though).
Question. Assume that $\vert d\vert\geq 3$ to avoid special cases. Is is true that $\pi=-1+\sqrt{d}$ is irreducible in $R=\mathbb{Z}[\sqrt{d}]$ ?
Remark. I can show this it is true in the following cases:
$d<0$
$d=1\pm p$, where $p$ is prime.
Apart from these cases, I have no idea whether $\pi$ might be irreducible in full generality or not when $d>0$. (I tried to use a CAS to produce examples and counterexamples, but I am really bad at programming so I didn't get very far.)
Addendum. I tried to determine first the values of $d$ for which $\pi$ is a prime element. This happens to be the case exactly when $d=1\pm p$, $p$ prime, so this does not give any new insight.
Update (February 21,2024). In his answer, Keith Conrad gives examples of integers $d\not\equiv 1 \ [4]$ for which $-1+\sqrt{d}$ is not irreducible.
When $d\equiv 1 \ [4]$, there are also such examples. For example, $(-1+\sqrt{41})=(7+\sqrt{41})(-6+\sqrt{41})$ is a non trivial factorization (the first factor has norm $8$ and the second one has norm $-5$).
Another example is $-1+\sqrt{57}=(7+\sqrt{57})(8-\sqrt{57})$.
Suppose $\mathbf Z[\sqrt{d}]$ has unique factorization, so it is the ring of integers in $\mathbf Q(\sqrt{d})$ (because UFDs are integrally closed), which implies $d$ is squarefree.
In a UFD, prime and irreducible elements are the same thing. An element $\alpha$ is prime exactly when the ideal $(\alpha)$ is a prime ideal, which makes $(\alpha)$ a maximal ideal: the residue ring $\mathbf Z[\sqrt{d}]/(\alpha)$ is finite and a finite integral domain is a field. The size of $\mathbf Z[\sqrt{d}]/(\alpha)$ is $|{\rm N}(\alpha)|$ and a finite field has prime-power order, so when $\mathbf Z[\sqrt{d}]$ has unique factorization, a necessary condition that an element $\alpha$ in this ring be irreducible is that the absolute value of its norm is a prime power.
Since $|{\rm N}(-1+\sqrt{d})| = |1 - d| = |d-1|$, when $\mathbf Z[\sqrt{d}]$ has unique factorization and $|d-1|$ is not a prime power, $-1+\sqrt{d}$ is not irreducible.
Example. When $d = 7, 11, 19, 22, 23, 31, 43, 46$, and $47$, $\mathbf Z[\sqrt{d}]$ is the ring of integers in $\mathbf Q(\sqrt{d})$ and has class number $1$, so it is a PID and thus has unique factorization. In these cases, $|d-1| = d-1$ is not a prime power.
In the first case, $d = 7$, an explicit factorization of $-1+\sqrt{7}$ into two non-units is $(\sqrt{7}+3)(2\sqrt{7}-5)$, where the factors are not units since they have norm $2$ and $-3$, respectively.
In the second case, $-1+\sqrt{11} = (3+\sqrt{11})(7-2\sqrt{11})$, where the factors have norm $-2$ and $5$.