There is no answer to that question specifically. Atmosphere aside, reaching orbit requires that you have horizontal orbital velocity at your insertion velocity (e.g.: around 8.7 km/s at 140 km altitude). To do this, your stage or stages must provide you with a total change in velocity (hereafter called delta-V or dV) that is equal to that orbital velocity.
However, because we have an atmosphere, we will lose energy to drag (drag losses). The most efficient way to get to orbital velocity is to go completely sideways, but we have an atmosphere in the way. To minimize drag losses we will have to go up above the atmosphere before we start going very fast, and fighting gravity (going up unnecessarily) incurs gravity losses.
The higher the TWR (thrust to weight ratio) of our rocket, the faster we can get up and stop fighting gravity. However, the higher the TWR, the faster we will be going in the low atmosphere, and the more we'll use to drag. The best balance seems to be an SLT (sea-level TWR) of 1.2 off the pad.
All said, for a typical rocket, it takes about 9.2 km/s dV to get to orbit after you include drag & gravity losses.
Now for staging. The rocket equation is how one calculates the dV imparted by a given rocket stage. Play around with it a bit, and you'll see that with a sufficiently efficient engine and a light enough tank (you need a very high wet-to-dry mass ratio), you can get 9.2 km/s dV out of a single stage. This is called an SSTO.
In practice, TSTO (two stages), 3STO, or TSTO with boosters are much more common. There are several reasons, but one you may not have considered is that because of the decreasing atmospheric density as you ascend, a static nozzle (that's most of them) will be either underexpanded at altitude or overexpanded at sea level. Here's a brief introduction. A TSTO can optimize its first-stage engines for sea level and its upper-stage engines for vacuum.
This is unsourced, but as a rule of thumb, for a TSTO, you want ~4 km/s dV and a ~1.2 SLT on the first stage and ~5 km/s dV and a ~0.8 ignition TWR on the upper stage. For a 3STO, you want ~3 km/s dV per stage with the same SLTs as before, unless you're using a kick stage to push you into orbit at apogee, in which case your ignition TWR should be as high as you can get away with.
As for ascent guidance, it's a very non-trivial problem. Luckily, I know some guys who have developed an excellent freeware ascent guidance calculator based on Primer Vector Guidance and are working on some new super magic ascent calculator that even considers the atmosphere. This is after they wrote one based on Powered Explicit Guidance, used by the shuttle, and before that a much more basic one that's probably similar to what you're interested in. They can help point you in the right direction. Here's their repo: Mechjeb-PVG.
But anyways, to answer your question: There is no number of stages needed to get to orbit. You can use as many or as few as will provide sufficient dV, accounting for drag & gravity losses.