Why do different elements have different number of isotopes? For example: Carbon-12,Carbon-13 and Carbon-14 are three isotopes of the element carbon with mass numbers 12, 13 and 14 respectively. Lithium-6 and Lithium-7 for lithium,etc.
My question is that are the number of isotopes for an element a random fact or there is a better explanation?
 A: 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. 
A: Every element with atomic number lower than lead has a most stable isotope that predominates in nature.  Lead(Pb)-208 is the heaviest known stable nucleus and most stable heavy metal. The stability is determined by least amount of binding energy required for keeping the nucleus together.  There are a number of factors at play here such as nucleon spin, odd-even proton number, coulomb repulsion, isomeric quantum levels, etc whose interplay is non-trivial and beyond the scope of question.  
Unstable and meta-stable isotopes are caused by external radiation or neutron absorption. These nuclear reactions that result in unstable nuclei are endothermic (requires energy input).  For example, Carbon-14 is generated when normal Nitrogen-14 is bombarded by cosmic rays in the upper atmosphere.
The radioactive isotopes exothermic decay back to the stable nucleus in an exponentially decreasing statistical time period know as half-life due to quantum tunneling.
