A linear function fixes the origin, whereas an affine function need not do so. An affine function is the composition of a linear function with a translation, so while the linear part fixes the origin, the translation can map it somewhere else.
Linear functions between vector spaces preserve the vector space structure (so in particular they must fix the origin). While affine functions don't preserve the origin, they do preserve some of the other geometry of the space, such as the collection of straight lines.
If you choose bases for vector spaces $V$ and $W$ of dimensions $m$ and $n$ respectively, and consider functions $f\colon V\to W$, then $f$ is linear if $f(v)=Av$ for some $n\times m$ matrix $A$ and $f$ is affine if $f(v)=Av+b$ for some matrix $A$ and vector $b$, where coordinate representations are used with respect to the bases chosen.
For many people, the two terms are identical. However, my personal preference (and one which some other people also adopt) is that a linear operator on $X$ is a linear transformation $X \rightarrow X$. This is why it is common to hear phrases like "Let $T$ be a linear operator on a separable Hilbert space" without specifying the codomain.
Best Answer
A linear transformation is any transformation $f:U\to V$ between vector spaces over $\mathbb F$ for which
for all $x,y\in U$ and all $\alpha\in\mathbb F$.
An affine transformation is any transformation $f:U\to V$ for which, if $\sum_i\lambda_i = 1$, $$f(\sum_i \lambda_i x_i) = \sum_i \lambda_i f(x_i)$$ for all sets of vectors $x_i\in U$.
In effect, what these two definitions mean is:
Take an example where $U=V=\mathbb R^2$. Then $$f:(x,y) \mapsto(-2x+y, 3x+8y)$$ is a linear transformation, since
$$f((x_1,y_1)+(x_2, y_2)) = (-2(x_1+x_2) + y_1+y_2, 3(x_1+x_2) + 8(y_1+y_2)) = \\ = (-2x_1 + y_1, 3x_1 + 8y_1) + (-2x_2 + y_2, 3x_2 + 8y_2) = f((x_1,y_1)+f((x_2, y_2))$$
However, $$g:(x,y)\mapsto (-2x+y+5, 3x+8y-2)$$ is not a linear function (you can immediatelly see this since $g((0,0)) \neq (0,0)$, while linear functions always map $0$ to $0$).
Both $g$ and $f$ are (you can check) affine functions.