If $f$ is a finite flat map, there exists maps $f^*:\mathrm{Pic}\, Y\to \mathrm{Pic}\, X$ and a map $f_*$ in the reverse direction, with the composite $f_*f^*$ multiplication by $\deg f$. $f_*$ is defined as follows. For a line bundle $M$ on $X$, $f_*(M)\in \mathrm{Pic}\, Y$ is $\Lambda^df_*M\otimes (\Lambda^d f_*\mathcal{O}_X)^{-1}$, where in the last expression, $f_*M$ is the direct image as coherent sheaves and $d=\deg f$. So, under such a map, if $f^*L=\mathcal{O}_X$, then $L$ is torsion. Conversely if $L$ is torsion, you can construct a variety $X=\mathrm{Spec}\, \mathcal{O}_Y\oplus L\oplus L^2\oplus\cdots \oplus L^{d-1}$, where $d=\mathrm{ord}\, L$, $f:X\to Y$ the induced finite flat map and $f^*L=\mathcal{O}_X$.