This is well-known material, so probably the question is not really suitable for MathOverflow. Anyway, since the subject can be non-trivial for someone approaching it for the first time, let me give a short answer in the case of a compact, complexcompact, Kähler manifold $M$.
The group $H^2(M, \, \mathbb{Z})$ classifies complex vector bundles on $M$, in other words the transition functions are assumed to be smooth and with values in $\mathsf{GL}(1, \, \mathbb{C})=\mathbb{C}^*$. In particular, if some power of $L$ is the trivial line bundle and $H^2(M, \, \mathbb{Z})$ is torsion-free, then $L$ itself is trivial in the topological sense.
Holomorphic line bundles on $M$ are instead classified by the Picard group $H^1(M, \, \mathcal{O}_M^*)$. Passing to cohomology in the exponential sequence $1 \to \mathbb Z \to \mathcal{O}_M \to \mathcal{O}_M^* \to 1$, we obtain an exact sequence $$0 \longrightarrow \mathrm{Pic}^0(M) \longrightarrow \mathrm{Pic}(M) \stackrel{c_1}{\longrightarrow} H^2(M, \, \mathbb{Z}),$$ where $\mathrm{Pic}^0(M)=H^1(M, \, \mathcal{O}_M)/H^1(M, \, \mathbb{Z})$ is a complex torus of dimension $q(M)=h^{1, \, 0}(M)$$q(M)=h^{0, \, 1}(M)= h^{1, \, 0}(M)$ and $c_1$ is the first Chern class (here we use in an essential way the Kähler assumption, see G. Elencwajg comments below).
In particular, if $q(M) >0$ the complex torus $\mathrm{Pic}^0(M)$ has strictly positive dimension, so we have a lot of non-trivial, torsion line bundles on $M$ (in the holomorphic sense) even if there is no torsion in $H^2(M, \, \mathbb{Z})$. Of course these torsion line bundles are in the kernel of $c_1$, so they are all trivial in the topological sense.