Suppose that $Y,U$ are independent random variables (r.v.'s) such that $h(Y)=U+Y$ for some (Borel-measurable) function $h$. Then $U=Z:=h(Y)-Y$ and $U,Z$ are independent. So, $U$ is independent of itself. So, $U$ is constant almost surely (a.s.): $P(U=u)=1$ for some real $u$. (Indeed, if $U$ is not constant a.s., then the support of the distribution of $U$ contains at least two real numbers $a,b$ such that $a<b$. Take any $c\in(a,b)$. Then the independence of $U$ of itself implies $0=P(U<c,U>c)=P(U<c)P(U>c)>0$, a contradiction.)
Vice versa, if $P(U=u)=1$ for some real $u$, then $h(Y)=U+Y$ a.s. with $h(Y):=u+Y$.
Thus, if $Y,U$ are independent, then there exists a (Borel-measurable) function $h$ such that $h(Y)=U+Y$ if and only if $U$ is constant a.s.
Unfortunately, the OP has changed the question, thus invalidating the above answer. The changed question admits a trivial answer as well, though, and after the change the "almost never" answer becomes "always".
Indeed, the r.v. $Y$ is assumed to have a density $g$. So, the distribution of $Y$ is atomless. So, $$T:=F_Y(Y)$$ has the uniform distribution on the interval $(0,1)$, where $F_V$ is the cdf of a r.v. $V$. So, $Z:=U+Y$ equals $F_Z^{-1}(T)$ in distribution. That is, $U+Y$ equals $h(Y):=F_Z^{-1}(F_Y(Y))$ in distribution, as desired.
(As usual, $F^{-1}(t):=\inf\{x\in\mathbb R\colon F(x)\ge t\}.$)