There are 477 spells in DnD 5e’s main three sourcebooks: the Player’s Handbook, Xanathar’s Guide to Everything, and Tasha’s Cauldron of Everything. This does not take into account spells found in other sourcebooks, of which there are many (Icewind Dale: Rime of the Frostmaiden, Acquisitions Incorporated, Fizban’s Treasury of Dragons, Strixhaven: A Curriculum of Chaos, Explorer’s Guide to Wildemount — to name a few).
Some books, like Guildmaster’s Guide to Ravnica, Sword Coast Adventurer’s Guide, and Elemental Evil Player’s Companion, had their spells later incorporated into Xanathar’s and Tasha’s.
There are 361 spells in the Player’s Handbook, 95 spells in Xanathar’s Guide to Everything, and 21 spells in Tasha’s Cauldron of Everything. These books have the majority of DnD 5e’s spells, by a very wide margin.