The spin of atomic nuclei can be predicted based on the knowing the number of protons and neutrons in the nucleus:
- Even/Even. Nuclei that contain an even numbers of protons and an even number of neutrons have $I = 0$ and are NMR silent. Examples include $\ce{^{12}C}$, $\ce{^{16}O}$ and $\ce{^{32}S}$.
All other nuclei are NMR active:
Odd/Odd. Nuclei that contain an odd number of protons and an odd number of neutrons have I that are positive integers. Examples include $\ce{^2H}$ $(I=1)$, $\ce{^{14}N}$ $(I=1)$ and $\ce{^{10}B}$ $(I=3)$.
Odd/Even & Even/Odd. All other nuclei (odd/even and even/odd) have spins that are half integral. Examples include $\ce{^1H}$ $(I=1/2)$, $\ce{^{11}B}$ $(I=3/2)$, $\ce{^{13}C}$ $(I=1/2)$, $\ce{^{17}O}$ $(I=5/2)$, $\ce{^{19}F}$ $(I=1/2)$ and $\ce{^{31}P}$ $(I=1/2)$.
A precise formulation is far more complex, and arises from the fact that the key components of the nucleus (proton and neutron) are made up of quarks. The neutron, although neutral in charge, is actually made of 3 quarks (udd), which themselves are charged, and not uniformly distributed about the neutron 'sphere'. Protons also consist of 3 quarks (duu). The nuclear spin comes from the total angular momentum of all these quark components. To delve deeper is probably outside the realm of chemistry, and is probably better suited to a physics forum (at least it is outside my ability to explain).