We make a complete study of the basic families of resonant periodic orbits of extrasolar planetary systems with two planets, based on the model of the general three body problem. These periodic orbits determine the topology of the phase space of a planetary system and consequently play an important role in understanding the dynamics of these systems. The families of periodic orbits indicate the regions of phase space where stable motion is expected, because it is close to a stable periodic orbit that a real system is expected to exist. A real planetary system is expected to be close to a resonant periodic orbit, and this is the case with several extrasolar planetary systems that have been discovered up to now. In addition, the systematic study of the periodic orbits helps us to understand the factors that affect the stability of a planetary system. It is found that the phase (position of the two planets at t=0) plays an important role on the stability, and the change of the phase may destabilize the system. The ratio of the masses of the planets plays also an important role on the stability of the system and the inversion of the masses may destabilize the system for some resonances and some phases. It is also indicated that the increase of the eccentricities may stabilize the system. An application of the above is made for the extrasolar systems HD 82943, Gliese 876 and 47 Uma .