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).