As many as you can handle and still get A’s in most/all of them. As far as which, it depends upon what your school offers, but should be across all (or most) core subjects, not just STEM.
There’s no magic formula, but if you’re getting B’s in honors chem, AP Chem might not be the way to go.
In terms of number, 1 or 2 for a fresh/soph (if allowed) is a good start. More than 4 as a junior or senior could p0rove too challenging for even the most motivated of students. More AP classes does not mean a better chance of getting into your top college.