“How many spells do I know?”

It depends. Some classes know all of their spells. They don’t have any concept of having to learn new spells. A class like this is the Cleric — a Cleric never needs to actively learn new spells. The entire pool of Cleric spells is available for them to work with.

On the other hand, other classes do need to expressively learn new spells. An example of this is a Wizard — Wizard’s have their spellbook, and they can only work with spells that they know. Another example would be the Sorcerer — though they don’t have a spellbook, they have a limited number of spells that they know and thus can make use of. Classes like this learn new spells every time they level up, plus they can sometimes learn new spells via in game actions (for example, a Wizard finding a spell and copying it into her spellbook)

For those classes which expressively do learn new spells each level, the actual process is easy: simply consult the PHB and choose which new spells you want to learn from your classes spell list.

More examples!

Bill is playing Wraxan, a 3rd level Sorcerer.

At 1st Level, Wraxan knew two 1st level spells. Bill chose:

Burning Hands (A 1st level Spell)

Mage Armour (A 1st level Spell)

When Wraxan hit 2nd Level, he knew 3 spells. As he still only had access to 1st Level Spell slots (and therefore could only learn 1st Level Spells), Bill chose Witch Bolt (A 1st Level Spell).

As Wraxan hit 3rd level, he gained his first two 2nd level Spell Slots, and he knew 4 spells in total. This means Bill could have chosen another 1st level Spell for Wraxan to learn if he wanted, or his first 2nd level Spell. He decided to go for a 2nd Level Spell, and Wraxan learned Scorching Ray (A 2nd Level Spell).

So, as it stands, Wraxan knows the following spells:

Burning Hands (A 1st Level Spell)

Mage Armour (A 1st Level Spell)

Witch Bolt (A 1st Level Spell)

Scorching Ray (A 2nd Level Spell)

As a 3rd level Sorcerer, Wraxan has four 1st level Spell Slots, and two 2nd level Spell Slots. Therefore, a day of spell casting for Wraxan could look like any one of the following:

he ends up needing to cast Burning Hands a whole bunch (hey, Goblins don’t cook themselves). He casts it three times using three 1st Level Spell Slots, then twice more using his two 2nd Level Spell Slots (as Burning Hands gets a nice bonus when cast with a higher level Spell Slot) then finally one more time with his last 1st level Spell Slot. Goblins cooked, he takes a long rest, and gets all his Spell Slots back.

he casts Burning Hands, Mage Armour, and Witch Bolt once each, all with 1st level Spell Slots. He ends up not needing to cast any more magic that day. He takes a long rest, and gets all his Spell Slots back in the morning.

he casts Scorching Ray twice, using up both his 2nd level Spell Slots. He wants to cast Scorching Ray another time (Goblins don’t scorch themselves either, OK?) but is out of 2nd level Spell Slots! So he casts Burning Hands instead (as he hasn’t used any of his 1st level Spell Slots yet).

And that’s that! Many classes work in the same way, knowing a limited selection of their class spell lists.

“But…!”, I hear you cry, “my class page says stuff about preparing spells?!”