Things are different now. The Wizard and Sorcerer from prior editions have now combined into one class, called... the Wizard. Also, the Cleric picked up the same mechanics.
(Meanwhile, something mechanically new has emerged in 5e to take the name of 'Sorcerer', which has picked up some different stuff for its defining features, like a spell point mechanic.)
Credit to GMNoob, who taught me the basics.
Revisiting 3.x for contrast
If you've played 3.x or Pathfinder, you'll be familiar with this:
- A Sorcerer just knows his spells. He fires them off through his spell slots when he needs them. He can cast the same spell as many times as he wants, given enough spell slots.
- Wizards have a spellbook of known spells. She prepares her spells by pre-baking them into each of her spell slots, and fires those pre-baked spells off later. She can cast the same spell only as many times as she has it prepared.
- Clerics work like the Wizard, but have access to their entire class spell list, and can give up a prepared spell for some limited spontaneous casting.
So what's D&D 5e done with this?
The spell process, from learning to preparation to casting, now offers the best of both prepared and spontaneous casting. I'll go through this level by level: what you know, what you have prepared, and what you can cast. Each level builds on the last.
- Spells known: The Wizard has a spellbook containing the spells they know, just as before, and the Cleric "knows" their entire class spell list.
- Preparation: From the spells you know, pick some spells you'd like to be able to cast today. You will now be able to cast these today. That's it! You're done here. (You don't put these into spell slots, and you don't pick the same spell multiple times.)
- If you're a Cleric, the number of spells is wisdom modifier + Cleric level, or if you're a Wizard, it's intelligence modifier + Wizard level.
- You can only prepare a spell if you have a spell slot of its level.
- Casting: Now, for the rest of the day, consider yourself to be like the Sorcerer of prior editions. The spells you have prepared are the spells you can spontaneously cast for the rest of the day. If you need to cast a spell, pick one, and cast it through a spell slot that is the same level of the spell or higher. You can cast the same spell over and over, as long as you have the spell slots for it. (Casting it doesn't make it no longer prepared. It's still there. You can cast it again.)
- Many spells have greater power or additional effects if you cast them through a higher level spell slot than necessary: Cure Wounds cures an amount in proportion to the spell slot it's cast through, for example.
Free casting: Cantrips and Rituals
There's a couple of features that grant you a lot of free spellcasting throughout the day. Both are described on the opening page of Chapter 10: Spellcasting, on page 78.
Cantrips: These are 0-level spells you always know and always have available to cast. You don't prepare these, and they don't use spell slots. The books say that "repeated practice has fixed the spell in the caster's mind". It seems that Wizards never even need to write them in a spellbook, since nothing ever mentions doing so, contrast to all the other rules for learning non-Cantrip spells.
Rituals: These let you cast a spell without using up a spell slot, or possibly without even having prepared it. It has to be marked as a (ritual) spell, it takes longer to cast, and it can't be empowered via casting through a higher level spell slot. The Ritual Casting feature of a class will describe further how they handle rituals.
- Clerics have to have a spell prepared to be able to cast it as a ritual.
- Wizards just need to have the spell in their spellbook. (Now that they can access all of their own spells as rituals, maybe they can feel better about not knowing their entire class list of spells.)
Rituals will save a lot of spell slots in situations where you can sit down and take your time to cast a utility spell like Identify. For a Wizard, you can even leave those spells unprepared and save your prepared spells for other stuff.
What's this mean for people who played Clerics, Wizards and Sorcerers?
For those who played Wizards and Clerics in 3.x and Pathfinder and might play one now in 5e, this means you now no longer have to fret about the proportion of spells: you won't run into a situation where you're saying drat, I wish I'd prepared that spell in just one more slot today.
For those who played Sorcerers in prior editions and might play the Wizard in 5e, your spell choices are no longer for life, as long as you can change and add to the contents of your spellbook, and you still get spontaneous casting. You don't have access to every spell you know all at once any longer, but if you're like me, you'll consider it worth the trade-off. (Or you could play 5e's version of the Sorcerer, which is entirely different in its own right.)