Great question! It sort of depends on the budget, and/or the director.
Many films today use special effects to duplicate a rather small number of people into a large crowd. For example, Star Wars: Episode III, on the jungle island of Kashyyk, a war ensues of magnanimous proportion. The brainiacs at LIM accomplished this by shooting a group of about five wookie performers flailing arms and shouting war cries. Then, they scrambled the performers, had them swap weapon, and repeated the process. Then they repeated the process again, and again, and again and again. They then digitally pasted different takes at different depths, shades and speeds. This gave the illusion of a million-wookie attack force.
Film makers have been using this effect even long before the digital imaging age. They would use the same shooting method, but also physically move the performers around the expanse of a large set before superimposing film upon film.
Lower budget films will also use the few-man crowd technique, but instead of digitally copying and pasting, they will shoot the crowd in tight frames with dummy torsos above and out of the frame. This gives the illusion of a shot portraying just a small portion of a larger group.
Some directors have the budget, resources, and time to create digital crowds, but as realists, choose to hire a stampede of live extras in a massive directorial feat. Christopher Nolan is one of such realists. During the Battle of Wall Street scene in the Dark Knight rises, Nolan shot an onslaught of over 1,000 performers bashing and brawling down the snowy bottleneck. (Further look up how they recorded the Rises main theme chant!)
Another example of real-crowd display is the parade scene on Farris Bueler's Day Off. John Houghes and crew tell of sending out a mass invitation to be a part of a major feature film (impressively before Internet broadcast) and alongside a real parade, the pleasantly surprising turnout shot perfectly for this iconic scene.
In Selena, the crowd during the Houston Astrodome concert, the bottom few rows were real people and the top few rows were cardboard cut-outs disguised by flashing cameras in the upper rows.
Some crowds are also shot from real concerts or events, and the film stars are cut and pasted onto the stage, which is common in musical artist biopics. Others are completely digital.
There are many more techniques and quite creative combinations of the ones above and I'm more than certain others will develop!