How many studs does a wall need?
The base count is wall length in inches ÷ spacing, plus one. The "plus one" is the stud that closes the end of the wall: a 20 ft wall at 16 inches on center is 240 ÷ 16 = 15 spaces, which needs 16 studs. "On center" means the spacing is measured from the middle of one stud to the middle of the next, not the clear gap between them, which is why a 16 inch layout leaves about 14½ inches of open bay for insulation and drywall. Plate material is calculated here as 3 × the wall length, the usual arrangement of a single bottom plate plus a doubled top plate.
Treat the result as the starting quantity, not the shopping list. Real walls need extra lumber the length-and-spacing formula does not see: three studs (or two plus blocking) at each corner, backing where partition walls intersect, and king studs, jack studs, cripples and a header at every door and window. A rough habit is to add two to three studs per corner and per opening, then round up to the next whole stud. Ordering a few percent over also covers boards you reject for crowns, splits or twist, which is normal in a lift of framing lumber. If the wall is load bearing, the spacing, stud size and header sizing are set by code and by the load above, not by preference, so 24 inch spacing is not always a legal substitute for 16.
Estimate only, excluding corners, openings, headers, blocking and fasteners. Stud spacing, sizing and header requirements for load-bearing walls are governed by local building code; confirm with your plans or an inspector.