I believe the following is an elementary example: Let $X$ be the complement of a point in a compact smooth automorphism-free curve of genus at least two. Let $L$ be a non-trivial algebraic line bundle on $X$ (easy to produce such things). Then $L$ is analytically trivial because $X$ is Stein. Hence, there is an analytic isomorphism $L\simeq X\times A^1$. We see that there is no algebraic isomorphism by noting:
Suppose there is an isomorphism $$f: L\simeq X\times A^1$$ of algebraic varieties. Then $L$ and $X\times A^1$ are isomorphic as line bundles.
Proof: For any fiber $L_y$ of $L$, if we consider the composite $$p\circ f: L_y\rightarrow X\times A^1 \rightarrow X$$ of $f$ with the projection, it must be constant, since $X$ is not rational. Hence, we have $$f(L_y)\subset z\times A^1$$ for some point $z$. Since the map $L_y\rightarrow A^1$ thus obtained is injective, it must be of the form $ax+b$ for non-zero $a$, that is, $f$ induces an isomorphism $$L_y\simeq z\times A^1.$$ Also by injectivity, we see that $y\neq y'$ implies $f(L_y)=z\times A^1$ and $f(L_{y'})=z'\times A^1$ for $z\neq z'$. Now let $s:X\rightarrow L$ be the zero section. Then $$p\circ f\circ s: X\rightarrow X$$ is an injective map, and hence, must be the identity. Thus, $f$ is a fiber-preserving map. Now let $$q:X\times A^1 \rightarrow A^1$$ be the other projection, and $h=q\circ f\circ s$. So $h(y)$ is the image in $A^1$ of the origin of $L_y$. Then we get a fiber preserving isomorphism $g: X\times A^1\simeq X\times A^1$ that sends $(y,\lambda )$ to $(y, \lambda-h(y))$. So finally, $$g\circ f: L\simeq X\times A^1$$ is a fiber-preserving isomorphism of varieties that furthermore preserves the origin of each fiber. It must then be fiber-wise an isomorphism of vector spaces. Thus, it is an isomorphism of line bundles.