Why do different elements have different number of isotopes?

The main difference is gonna be the stability of the various isotopes. Most elements technically have a very large number of isotopes (carbon isotopes range from carbon 8 to carbon 22), but most of these have a very short half-life due to the poor stability of a number of neutrons too large (or too small). The list of isotopes will usually be either somewhat stable isotopes or, for more complete lists, experimentally detected isotopes.

The stability of those isotopes can be determined by the various nuclear models, such as the liquid drop model, nuclear shell model, etc etc. The liquid drop model is particularly useful to get a good intuition of the various factors contributing to nuclear stability.