Picard group of product of spaces
Ischebeck has proved that given an algebraically closed field $k$ and two normal integral algebraic $k$-schemes $X,Y$ there is an exact sequence of groups $$ 0\to Pic(X)\times Pic (Y)\to Pic(X\times Y)\to Pic (k(X)\otimes _k k(Y)) $$ Note that neither variety is supposed complete, nor affine, nor...
This is quite interesting because although other users have shown that the Picard group of the product of two varieties may be bigger than the product of that of the factors, Ischebeck gives a bound for the discrepancy.
In particular if one of the varieties, say $Y$, is rational, then the ring $k(X)\otimes _k k(Y)$ is a fraction ring $S^{-1}A$ of the polynomial ring $A=k(X)[T_1,...,T_n]$ over the field $k(X)$ and so is a UFD and thus has zero Picard group: $$Y\operatorname {rational}\implies Pic(X\times Y) =Pic(X)\times Pic (Y)$$
This is a vast generalization of $Pic( X \times\mathbb A^1) =Pic(X)$.
In some cases it is true:
If $X$ is a projective variety over an algebraically closed field $k$ such that $H^1(X,\mathcal{O}_X)=0$, and $T$ is a connected scheme of finite type over $k$, then $\mathrm{Pic}(X \times T) \cong \mathrm{Pic}(X) \times \mathrm{Pic}(T)$. This is exercise III.12.6. in Hartshorne's book.
Since $\mathrm{Pic}(\mathbb{A}^1)=0$, a special case of the question is the "homotopy invariance" $\mathrm{Pic}(X \times \mathbb{A}^1) \cong \mathbb{Pic}(X)$. This holds when $X$ is normal, but not in general (SE/432217).