Another answer has described morphisms of $\mathbb{A}^n$ within the category of affine schemes. Here's a discussion of maps in the category of affine spaces, since both are useful in many contexts.
$\mathbb{A}^n$ is a $k^n$-torsor, which means there's a regular group action of $k^n$ on $\mathbb{A}^n$, namely the one sending $x\in\mathbb{A}^n\mapsto x+v,v\in k^n$. This is usually intuitively described as $\mathbb{A}^n$ being $k^n$ without an origin. (Indeed there's a forgetful functor $U$ taking a vector space to its underlying affine space, as well as a functor $D$ taking $\mathbb{A}^n$ to $k^n$. These aren't quite adjoints, because $UD$ isn't naturally isomorphic to the identity functor on the affine category.)
So the only operation we get inside $\mathbb{A}^n$ is subtraction: $x-y$ is the unique $v\in k^n$ such that $x+v=y$. Then the endomorphisms of $\mathbb{A}^n$ are its endomorphisms as a $k^n$-torsor, which might be described as $f:\mathbb{A}^n\to\mathbb{A^n}$ such that $f(x)-f(y)=A(x-y)$ for $A$ a linear transformation $k^n\to k^n$, a map that preserves subtraction "up to a linear transformation."
If you were to (non-naturally) associate $\mathbb{A}^n$ with $k^n$, you would see that the affine linear maps $f: v\mapsto Av+u$ satisfy the above definition, while conversely you could get $u$ as the image of whatever affine point was sent to $0$ and $A$ as the $f-u$, but it's cleaner to avoid using the functor $D$.