Thousands, and realistically tens of thousands once you count every platform, region, and release variation. There is no exact figure, because no single body catalogues every game ever published, and the number grows daily with digital distribution.
Databases like IGDB, MobyGames, and Wikidata come closest to comprehensive lists, each covering a slightly different slice of history. MobyGames in particular runs to well over a hundred thousand entries.
If you want a number, treat any specific claim with caution. The honest answer is "a lot, and more all the time."