Let $X$ a scheme and $ \mathcal{L}$ a invertible $\mathcal{O}_X $-module, therefore locally isomorphical to structure sheaf $\mathcal{O}_X $.
We know, that a morphism of sheaves $\phi:\mathcal{F} \to \mathcal{G}$ on $X$ is an isomorphism if and only if for every $x \in X$ the induced morphism $\phi_x:\mathcal{F}_x \to \mathcal{G}_x$ in stalks is an isomorphism. Because $ \mathcal{L}$ locally isomorphic to $\mathcal{O}_X $ so we have $\mathcal{L}_x \cong \mathcal{O}_{X,x}$ in each $x \in X$.
Why in general $\mathcal{L} \cong \mathcal{O}_X$ doesn't hold for every invertible sheaf $ \mathcal{L}$?
The stalks being isomorphic is a local property and the sheaves being isomorphic is a not a local property. The former does not always determine the latter. To get some non-AG motivation consider the case of the following two maps:
Locally the preimage of a sufficiently small neighborhood of any point $z\in S^1$ under both these maps is a countable disjoint union of open intervals. So locally both these maps look indistinguishable, but you would not claim that the real line is a disjoint union of bunch of circles.
To expand on @Roland's answer, if you take $\mathcal O_X(n)$ for $X=\mathbb P^1 (k)$, then for negative $n$, the only global section of these sheaves is $0$ and for positive $n$, the global sections are an $n+1$-dimensional vector space over $k$. This is because the global sections of $\mathcal O_X(n)$ are generated by the monomials of degree $n$.
None of these match the global sections of the structure sheaf $O_X$, which are just the constants, a $1$-dimensional $k$-vector space. So $\mathcal O_X(n)$ is not isomorphic to $\mathcal O_X$ for $n\neq 0$.