Suppose $M$ is a closed oriented $2n$-manifold which admits a complex spin ($\text{Spin}^c$) structure, which means that its second Stiefel-Whitney class $w_2(M) \in H^2(M, \mathbb{Z}_2)$ is the $\bmod 2$ reduction of a class $c_1(M) \in H^2(M, \mathbb{Z})$; this holds in particular if $M$ admits an almost complex structure or if $H^3(M, \mathbb{Z})$ has no $2$-torsion.
Then the Chern classes $c_k(V) \in H^{2k}(M, \mathbb{Z})$ of a complex vector bundle $V$ satisfy integrality conditions coming from the following version of the Hirzebruch-Riemann-Roch theorem, which is a consequence of the Atiyah-Singer index theorem: there is a rational characteristic class $\text{td}(M) \in H^{\bullet}(M, \mathbb{Q})$, the Todd class of $M$, given by
$$\text{td}(M) = e^{ \frac{c_1(M)}{2} } \hat{A}(M)$$
where $\hat{A}(M)$ denotes the $\hat{A}$ class of $M$, such that
$$\int_M \text{ch}(V) \text{td}(M) \in \mathbb{Z}$$
where $\text{ch}(V)$ denotes the Chern character of $V$ and $\int_M$ denotes the pairing of a class in $H^{\bullet}(M, \mathbb{Q})$ with the fundamental class $[M]$. Note that the integrand lives in even degrees and so this statement only has content for even-dimensional manifolds.
To get something easier to work with, suppose in addition that every component of $\text{td}(M)$ but the zeroth component $\text{td}_0(M) = 1$ and the top component $\text{td}_n(M)$ vanishes. Then the index theorem reads
$$\int_M \left( \text{ch}_n(V) + \text{td}_n(M) \right) \in \mathbb{Z}$$
and hence applying the theorem twice, once to the trivial vector bundle and once to $V$, an equivalent statement is that
$$\int_M \text{ch}(V) = \int_M \text{ch}_n(V) \in \mathbb{Z}.$$
When $n = 2$, so $M$ is a closed oriented $4$-manifold with a complex spin structure, the vanishing condition is that $\text{td}_1(M) = \frac{c_1(M)}{2} = 0$ vanishes (rationally). This follows, for example, if $M$ admits a spin structure ($w_2(M)$ vanishes) and the complex spin structure is chosen so that $c_1(M) = 0$. The integrality condition is then that
$$\int_M \text{ch}_2(V) = \int_M \frac{c_1(V)^2 - 2 c_2(V)}{2} \in \mathbb{Z}$$
or equivalently that $c_1(V)^2$ is even. If $M$ is simply connected and $w_2(M) = 0$ then in fact every class in $H^2(M, \mathbb{Z})$ has this property (see e.g. this blog post) but in general I think it's an extra condition.
If $M$ is stably frameable then all of its stable characteristic classes vanish, and in particular (with a complex spin structure in which $c_1(M) = 0$) all of the components of $\text{td}(M)$ except the zeroth one vanish, so $M$ satisfies the vanishing condition. In particular this is true if $M = S^{2n}$. Moreover, because $S^{2n}$ has vanishing cohomology in degrees between $0$ and $2n$, a straightforward computation shows that if $V$ is any complex vector bundle on $S^{2n}$, then
$$\text{ch}_n(V) = \frac{c_n(V)}{(n-1)!}.$$
The integrality condition is then that $c_n(V)$ is divisible by $(n-1)!$, as mentioned in Liviu Nicolaescu's answer.