The Srimad Bhagavatham (Canto 12, chapter 4) speaks about 4 kinds of Pralaya- Nitya, Naimittika, Prakritika, and Atyantika.
Nitya Pralaya is one which is constant. The birth and deaths we always witness.
When the day of Brahmaa ends and he lays in sleep, it is called Naimittika Pralaya. Here, the manifested cosmos or Brahmanda is absorbed into Hiranyagarba and exist in potential state during night of Brahmaa.
Now, when the 100 years of Brahmaa is over and Brahmaa dies, it is called Prakritika Pralaya. Here, Hiranyagarbha, along with all manifested universe becomes absorbed into the Unmanifested state of Prakriti (Mula Prakriti). Hence, this is called Prakritika Pralaya.
When a person overcomes Ignorance/Avidya using Vivekam and attaines Atma-Jnanam and perceives Non-duality alone, it is Atyantika or final destruction of all duality.
Now, if the question is, what will happen if all the souls inhabiting whole manifested cosmos attains Moksham, then the answer is that, there is Atyantika Pralaya is cosmic scale and the whole duality comes to end.
And, if by earth, you refer to Bhuloka-Physical realm, then there are souls in other realms as well. So, nothing will happen. In fact, it is not possible that all souls on Bhu Loka alone will attain Moksha.
If by earth, you mean planet earth, then even if all humans attain Moksha simultaneously, on a cosmic scale, the effect will be minimal. As there may be many other planets in physical universe itself with life on it.
Us this link to refer to Srimad Bhagavatham- http://www.vedabase.com/en/sb/12/4