One example to think about: Spec O_K, for K a number field and O_K its ring of integers. Then the Picard group of all invertible sheaves is isomorphic to the class group.

The main point though is that for a scheme X over Spec Z, one should think of this as a family of schemes which package, for each prime p, a choice of reduction mod p of the scheme X \otimes_Z \Q. A good place to learn about this is Silverman's two books on elliptic curves, especially the chapter on Neron models in the second. It is very basic with examples and exercises.