I will consider $X$ over an algebraically closed field $k$, and let $\ell$ be prime to the characteristic of $k$. The Kummer sequence $1 \to \mu_{\ell^n} \to \mathcal O_X^{\times} \buildrel \ell^n \over \to \mathcal O_X^{\times} \to 1$ on the etale site of $X$ induces $Pic(X)/\ell^n \to H^2(X,\mu_{\ell^n}).$ Passing to the inverse limit over $n$ gives an injection $\bigl((Pic(X)/Pic^0(X)\bigr) \otimes_{\mathbf Z}\mathbb Z_{\ell} \hookrightarrow H^2(X,\mathbb Z_{\ell})(1).$ (Here $Pic^0(X)$ denotes the connected part of $Pic(X)$ --- which is trivial in the case of a $K3$, although we don't need this, and $(1)$ denotes a Tate twist, which is important if $X$ is base-changed from a subfield and you want to consider Galois actions, but not otherwise.)
So the bound on the Picard rank of $X$, i.e. on the rank of $Pic(X)/Pic^0(X)$ comes from a knowledge of the dimension of the etale cohomology $H^2(X,\mathbb Z_{\ell}).$ This has dimension 22 in the case of a K3, hence the desired bound (for any field $k$). There is no better bound achievable without Hodge theoretic arguments, which aren't available in characteristic $p$.
It is helpful to consider the situation with $K3$s, and the difference between the char. $0$ and char. $p$ situations, by analogy with the case of endomorphisms of elliptic curves. Indeed, the same argument as above, applied with $X$ taken to be a product of an elliptic curve $E$ over itself, will show that the Picard rank of $E\times E$ is at most $6$, and hence that the rank of $End(E)$ is at most $4$ --- the divisors on $E\times E$ modulo algebraic equivalence come from $E\times O$ and $O\times E$, which always contribute a rank of $2$, and then from the graphs of endomorphisms, which give the remaining rank, which hence is at most $4$. If $E$ is supersingular in characteristic $p$ then in fact $End(E)$ is of rank $4$. On the other hand, in characteristic $0$, Hodge theoretic arguments (or arguments with the representation $E = \mathbb C/\Lambda$, which are concrete analogues of the Hodge theoretic arguments) show that the Picard rank of $E\times E$ is bounded by $4$, and hence that the rank of $End(E)$ is at most $2$.