Suppose we're working over an algebraically closed field $k$. If $V\subseteq\mathbb{A}^n$ and $W\subseteq\mathbb{A}^m$ are affine algebraic sets, there is a well known bijective correspondence $$ \operatorname{Mor}_\mathrm{reg}(V,W)\leftrightarrow\operatorname{Hom}_{k-\mathrm{alg}}(k[W],k[V]). $$
I assume this fails in general if $V$ and $W$ are not affine algebraic sets. Consider the case where $V=\{*\}$ is a point, and $W=\mathbb{A}^2\setminus\{(0,0)\}$. So $V$ is affine, but it's also a well known fact that $W$ is not affine. My question is, why does the natural map
$$ \operatorname{Mor}_{\mathrm{reg}}(V,W)\to\operatorname{Hom}_{k-\mathrm{alg}}(k[W],k[V]) $$
fail to be surjective, so that the bijection does not hold in this case?
This is similar to Hoot's answer, but since you wanted more detail, I thought I'd add it.
I tried to translate this result into classical language the best I could. Hopefully it makes some sense to you!
There is a very nice theorem, called algebraic Hartog's lemma, which says the following (in classical language)[you can find the proof in Vakil, or Qing Liu]
The algebraic version of this theorem says that if $A$ is a normal domain, then
$$A=\bigcap_{\text{ht}(\mathfrak{p})=1}A_\mathfrak{p}$$
where the intersection takes place in $\text{Frac}(A)$. Intuitively, it says that since the zero set of a function has codimension 1, any open subset, which is the complement of a set of codimension at least $2$, can't invert anything. More symbolically, if $\displaystyle \frac{f}{g}$ is to be a function on $X-Z$, you need that the vanishing set $V(g)$ of $g$ is contained in $Z$. But, $V(g)$ has dimension $n-1$, so if $Z$ has dimension less than or equal to $n-2$, you can't have $V(g)\subseteq Z$. So, you can't invert anything.
In particular, this says that if we consider the inclusion $\mathbb{A}^2-\{(0,0)\}\to \mathbb{A}^2$, then the induced map of rings of functions $k[\mathbb{A}^2]\to k[\mathbb{A}^2-\{(0,0)\}]$ is an isomorphism of $k$-algebras. So, now, assume that the map
$$\text{Mor}(\ast,\mathbb{A}^2-\{(0,0)\})\to \text{Mor}(k[\mathbb{A}^2-\{(0,0)\}],k)$$
were a bijection. Then, consider the following commutative square
$$\begin{matrix}\text{Mor}(\ast,\mathbb{A}^2-\{(0,0)\}) & \to & \text{Mor}(k[\mathbb{A}^2-\{(0,0)\}],k)\\ \downarrow & & \uparrow\\ \text{Mor}(\ast,\mathbb{A}^2) & \to & \text{Mor}(k[\mathbb{A}^2],k)\end{matrix}$$
where the left hand vertical map comes from the inclusion $\mathbb{A}^2-\{(0,0)\}\to\mathbb{A}^2$, and the right hand side comes from the restriction map $k[\mathbb{A}^2-\{(0,0)\}]\to k[\mathbb{A}^2]$.
Now, since $\mathbb{A}^2$ is affine, the bottom horizontal arrow is a bijection. By algebraic Hartog's lemma, the right vertical map is a bijection. So, if we assume that the top horizontal arrow is a bijection, then we must conclude that the left vertical map is a bijection--but it's not!
The key to all of the above was not really just that $k[\mathbb{A}^2]\cong k[\mathbb{A}^2-\{(0,0)\}]$, but that (by algebraic Hartog's lemma) it was the restriction map that induced the isomorphism of $k$-algebras.