In physics, in the USA, you normally enter a PhD program directly after finishing a bachelor's degree. The first two years are mainly coursework (usually along with some research work), after which you can, if you like, "pick up" a master's degree. Then you work on your dissertation research for 3-5 years and end up with your PhD. Standalone masters' degree programs are usually "terminal" degrees that are not intended to lead into a PhD program.
In other countries the master's and PhD programs are usually separate, and you complete a master's degree before entering a PhD program. The same may also be true in some other fields in the USA; I don't know about math specifically.