Too Few Lands, Too Many Lands
Every game of Magic can go wrong in two opposite ways. You draw too few lands, and the spells in your hand cost more mana than you have; players call this mana screw. Or you draw too many, and you have mana with nothing to spend it on; that is mana flood. You can't stop either from happening sometimes, because the deck is shuffled. What you choose is how often.
Two things decide the right number of lands: how much your spells cost, and how many cards are in the deck. A deck of cheap spells needs less mana, so it can play fewer lands. A bigger deck needs more lands to keep the same share.
Reading a Mana Curve
Every card has a mana value, the total mana in its cost: Lightning Bolt ({R}) is 1, Grizzly Bears ({1}{G}) is 2, Hill Giant ({3}{R}) is 4. Count how many spells in your deck have each mana value and draw the counts as bars, and you get the deck's mana curve. Lands have no mana cost, so they sit outside the curve.
The curve tells you what your turns will look like. On turn two you have two lands, so you want something that costs two; on turn three, something that costs three. A deck with plenty of cards at 1, 2 and 3 does something useful from the start. A deck with most of its cards at 5 and 6, like Colossal Dreadmaw, spends its first turns doing nothing while the other player builds a board.
That's why most curves peak at two or three and fall away after that. A typical 60-card deck has a handful of one-drops (players call a card that costs one mana a "one-drop"), the most cards at two, a good number at three, fewer at four, and only a few at five and above. The average mana value of its spells is usually between 2 and 3.
The starting deck above, 24 lands with a curve that peaks at two, has its third land by turn three (going first, with nine cards seen) about four games in five, and its fourth by turn four nearly two games in three. Drop the lands to 17 and the turn three number falls to about half. Those odds are why 24 is the default: it is the point where you usually hit the lands your curve needs without drawing piles of extras.
How Many Lands: Rules of Thumb
Start from about two lands in every five cards, then move a land or two either way for your curve.
60-card decks: about 24 lands. A fast deck that wins with one- and two-mana creatures and never goes above three can play 20 to 22, since it never needs a fourth land. A slow deck that wants to cast six-mana spells on time may want 25 or 26. Cards that make mana, like Llanowar Elves, count a little toward your land total, but don't cut a land for each one: they can be destroyed, and they aren't lands you can rely on drawing early.
40-card Limited decks: about 17 lands, with 23 spells. That is a slightly higher share than 24 in 60, because Limited decks tend to have more expensive cards and fewer ways to fix a bad draw.
100-card Commander decks: about 36 to 38 lands. Commander games run long and the cards cost more, so most decks also add a few other mana sources on top. The format is in Commander for Beginners.
Good to know: when a new deck keeps getting stuck, add a land before you cut one. A missed land drop usually costs more games than a drawn extra land does.
Colors: Sources for What You Need Early
Land count is half the question. The other half is which colors your lands make. Each land that makes a color is a source of that color, and every colored symbol you need has to come from one.
The simple way to split lands is by how many cards of each color you play: twice as many red cards, twice as many Mountains. Then adjust for when you need each color. A card you want on turn one, like Llanowar Elves ({G}), needs a green source in your opening hand, so a deck with four of them wants many Forests. A card you cast on turn five has seen more cards by then, so a color you only need late can get by with fewer sources.
Costs with two symbols of one color ask for more, too. Serra Angel costs {3}{W}{W}, so you need two white sources, not one, by the turn you want to cast it. A deck with several cards like it leans its lands toward that color. If your deck has cards in both colors that need a symbol on turn one or two, that's a sign it may be stretched too thin, and a good reason to trim one color's early cards.
Puzzle: Lands for Three Decks
Three decks, three land questions. For each, choose the count or the split that fits what the deck is trying to do.
The answer, in words: the fast red deck plays about 21 lands, because nothing in it costs more than three. The green and red deck splits 16 Forests to 8 Mountains, because it needs green on turn one and red only later. The 40-card Limited deck plays 17 lands.
Questions New Players Ask
How many lands should be in a 60-card MTG deck?
About 24. A fast deck whose spells mostly cost one or two mana can play 20 to 22, and a slow deck full of expensive spells may want 25 or 26.
What is a mana curve in Magic?
A count of how many spells in your deck cost one mana, two, three and so on, usually drawn as a bar chart. A good curve has plenty of cheap spells and only a few expensive ones, so you can use your mana every turn.
How many lands should a Commander deck have?
Most Commander decks play 36 to 38 lands in their 100 cards, and many also play a few cards that make extra mana.