Your notion of a prime (i.e. non-composite) is generally known as an irreducible, indecomposable, or atom, i.e. an element of an integral domain $R$ having only "trivial" factorizations $\color{#c00}{{\rm in}\ R},\,$ i.e. if $\,p = ab,\ a,b\,\ \color{#c00}{{\rm in}\ R},\,$ then one factor is trivial (i.e. $1$ or a divisor of $1$, i.e. a unit = invertible $\color{#c00}{{\rm in}\ R}).\,$ Further atoms are assumed to be nonunits $\color{#c00}{{\rm in}\ R}.$ This definition does depend on the $\rm\color{#c00}{underlying}$ $\color{#c00}{\rm ring}$ since said factorizations and divisibilities depend on the multiplication table $\color{#c00}{{\rm of}\ R}$.
In particular, an atom $\,p\,$ need not remain an atom in an extension ring because its multiplication table may differ on such matters, e.g. we can always adjoin $\sqrt p$ to $R$ get a nontrivial factorization $\,p = \sqrt{p}\sqrt p\,$ by extending to $\,\bar R = R[x]/(x^2-p),\,$ i.e. $\,R[x]\bmod (x^2-p).\,$ In this quotient ring we have $\,p \equiv x^2\,$ and this factorization is nontrivial, i.e. $x$ is a nonunit in $\bar R,\,$ for otherwise $\, 1 \equiv x f(x)\pmod{\!x^2-p}$ for some $\,f\in R[x]\,$ so $\, 1 = xf(x) + (x^2-p) g(x),\,$ so evaluation at $\,x=0\,$ yields $\, 1= -p\:\!g(0)\,$ in $R$, so $\,p\mid 1\,$ in $R$, contra $p$ is an atom in $R$ so not a unit in $R$.
$p$ can also fail to persist as an atom in an extension ring if it becomes a unit, e.g. we can adjoin its inverse by passing to $R[x]/(px\!-\!1);\,$ e.g. as you note, $3$ becomes a unit when extending $\Bbb Z$ to $\Bbb R$.
Like atoms, by convention composites (nonatoms) are also usually assumed to be nonunits, so above the unit $3\in\Bbb R$ is neither an atom nor a composite.
Every non-zero real number is a unit
. What do we mean by "unit"? I suppose is not the same as $1$ because then it would mean everything is a prime – Jim Dec 18 '21 at 18:23