The reason is called the magnetic quantum number (and the reason m is used for it, rather than some other letter) is that when one imposes a magnetic field on an atom, the energy levels (determined only by n in the absence of ) are " split" by the Zeeman energy due to the interaction potential of the magnetic moment with the field (see above).
In 1925 Goudsmit and Uhlenbeck reported that, in addition to the "splittings" predicted by the quantization of the orbital angular momentum eigenstates of the electrons in an applied magnetic field, there were additional splittings of roughly the same magnitude that could only be explained in terms of some "extra" angular momentum associated with the electrons themselves. This was relevant to a previous result that had mystified the community:
In 1922, Stern and Gerlach had done an experiment on various neutral atoms passing through a region of large magnetic field gradient, the effect of which is to exert on the passing atoms a net force that is proportional to the component of their angular momentum along the axis of the gradient. This allowed Stern and Gerlach to experimentally verify that "spin 1" atoms (with ) did indeed have three and only three possible values of : or -1; and similarly for other integer . However, their experiments on neutral silver atoms revealed two possible projections of the angular momentum along the z axis, a range of options incompatible with the rules and . The discoveries of Goudsmit and Uhlenbeck suggested that the electron itself might have an intrinsic angular momentum that was (somehow) half as large as the smallest allowable nonzero orbital angular momentum - what we now call "spin ."