When are all ring homomorphisms also algebra homomorphisms? Let $k$ be an algebraically closed field, and let $A,B$ be two unitary $k$-algebras. In general, there are more ring homomorphisms $A\to B$ than there are $k$-algebra homomorphisms. More precisely, the forgetful functor from $k$-algebras to rings induces an injective map of sets $$j:\hom_{k\textrm{-Alg}}(A,B)\to \hom_{\textrm{Ring}}(A,B).$$

Question. Under what conditions on $k,A,B$ is $j$ a bijection?

There is a particular case I am looking at. I have a finite dimensional $k$-vector space $V$ and the ring $A=k[x,y,z]$. If $B=\textrm{End}_k(V)$ is the ring of $k$-linear endomorphisms of $V$, does $$\hom_{\textrm{Ring}}(A,B)\cong\hom_{k\textrm{-Alg}}(A,B)$$ hold in this case?
Thank you!
 A: As discussed in the comments, this almost always fails.  In particular, it fails in your example (as long as $V$ is nonzero): if $\alpha:k\to k$ is any automorphism, then you can define a ring-homomorphism $\varphi:k[x,y,z]\to \textrm{End}_k(V)$ by $\varphi(f(x,y,z))=\alpha(f(0,0,0))$ (where $\alpha(f(0,0,0))\in k$ acts on $V$ by scalar multiplication).  This will be a $k$-algebra homomorphism iff either $\alpha$ is the identity or $V=0$.
I don't know of any particularly useful criteria which make this true. But let me show that there do at least exist some examples.  For one thing, if $B=0$, then there is always a unique ring-homomorphism $A\to B$ which is $k$-linear.  For another, there are plenty of examples of $A$ and $B$ for which there are no ring-homomorphisms $A\to B$, and so again all the ring-homomorphisms will be $k$-linear.  For instance, $A$ might contain a division ring $K$ which does not embed in $B$ (e.g., because it has cardinality greater than $|B|$), and then there can't be any ring-homomorphisms $A\to B$ unless $B=0$.  Or more subtly, you might have something like $A=M_2(k)$ and $B=M_3(k)$.
For a final example, note that any field of characteristic $0$ is contained in a field with no nontrivial endomorphisms (see https://mathoverflow.net/a/61082/75).  In particular, if $A=B=K$ is such a field containing $k$, the only ring-homomorphism $A\to B$ is the identity, which is $k$-linear.  You can get some less trivial examples (in particular, examples where there are many different homomorphisms $A\to B$) by modifying this example: for instance, if $A=B=K[x]$, then any homomorphism $A\to B$ must send constants to constants (since the nonzero constants are exactly the units) and thus must be the identity on $K$.  
