The Stern-Gerlach experiment unexpectedly revealed the existence of spin back in 1922. Physicists Otto Stern and Walther Gerlach sent a beam of silver atoms through the poles of a magnet — whose magnetic field was in the z direction — as you can see in the following figure.
Because 46 of silver’s 47 electrons are arranged in a symmetrical cloud, they contribute nothing to the orbital angular momentum of the atom. The 47th electron can be in
The 5s state, in which case its angular momentum is l = 0 and the z component of that angular momentum is 0
The 5p state, in which case its angular momentum is l = 1, which means that the z component of its angular momentum can be –1, 0, or 1
That means that Stern and Gerlach expected to see one or three spots on the screen you see at right in the figure, corresponding to the different states of the z component of angular momentum.
But famously, they saw only two spots. This puzzled the physics community for about three years. Then, in 1925, physicists Samuel A. Goudsmit and George E. Uhlenbeck suggested that electrons contained intrinsic angular momentum — and that intrinsic angular momentum is what gave them a magnetic moment that interacted with the magnetic field. After all, it was apparent that some angular momentum other than orbital angular momentum was at work here. And that built-in angular momentum came to be called spin.
The beam of silver atoms divides in two, depending on the spin of the 47th electron in the atom, so there are two possible states of spin, which came to be known as up and down.
Spin is a purely quantum mechanical effect, and there’s no real classical analog. The closest you can come is to liken spin to the spin of the Earth as it goes around the sun — that is, the Earth has both spin (because it’s rotating on its axis) and orbital angular momentum (because it’s revolving around the sun). But even this picture doesn’t wholly explain spin in classical terms, because it’s conceivable that you could stop the Earth from spinning. But you can’t stop electrons from possessing spin, and that also goes for other subatomic particles that possess spin, such as protons.
Spin doesn’t depend on spatial degrees of freedom; even if you were to have an electron at rest (which violates the uncertainty principle), it would still possess spin.