In 5e a wizard can learn any number of spells and cast certain spells as rituals. This takes 10 minutes (+ original casting time) and you can do it even if the spell is not prepared. This does not cost a spell slot.
A PF2 spell substitution wizard can also learn any number of spells, and they can cast ANY spell they know at any level in 10 minutes (+ original casting time), even if it is not prepared. This includes cantrips too.
While in 5e this does not cost a spell slot, the ritual tag is rather rare. Even in contrast to that, the potential of spell substitution is VAST. As a wizard, you can learn any number of spells. Which, if you have coin and sense, means ALL of them. Situational spells that other classes would skip as inefficient are your bread and butter. Out of combat spending 10 minutes on a spell is usually much better than the alternative. For example, I substituted in spider climb to allow a party member to get down a cliff safely. Going around it or finding a better spot could have taken an hour or more. I did not have any idea that we will have to get down a cliff, but I didn’t need to. In 5e you either had prepared spider climb or you did not, as it is not a ritual spell.
Friendly tip: Prepare spells that you might need in a hurry (e.g. feather fall, fireball). Do not bother with any spells with a casting time of 1min+, if you have that amount of time, you usually have 10 minutes to substitute it.
A PF2 sorcerer fills a very different niche. I they want to cast a spell at a different level, they have to LEARN it at a different level, with the exception of their signature spells, which are limited in number. So while they are flexible within the level, they are quite restricted outside of it. For combat spells this is barely an issue, but most utility spells have qualitatively different effects when cast at different levels, making them waste either known spells or a signature spell to make use of them properly.
Thus, if you want to play a combat mage, you will probably fare better as a sorcerer. If you look at magic as more of a tool than a weapon, go with wizard (of course, spell substitution is heavily recommended). The sorcerer will be able to spontaneously pull out their signature fireball at any time, but the wizard will be able to practically do so with spider climb, illusory object, comprehend languages, temporary tool, create food, shrink item, … etc etc
PF2 wizards do get an equivalent of Arcane Recovery, called Arcane Bond / Drain Bonded Item. Its function is quite similar, allowing you to regain spent spell slots.
Wizards have effectively the same number of slots as sorcerers. The wizard spell slots table on p.205 does not include the spell they can prepare from their Arcane School. If they do not have a school (a Universalist), they have a matching number of uses of Drain Bonded Item. Adding this +1 per spell level brings Universalists to the same number as sorcerers. Those with an Arcane School have 1 use of Drain Bonded Item on top of this.