Bhagavad Gita Chapter 14, Text 14

Bg 14.14

yada sattve pravrddhe tu
pralayam yati deha-bhrt
tadottama-vidam lokan
amalan pratipadyate

Word for word: 
yada — when; sattve — the mode of goodness; pravrddhe — developed; tu — but; pralayam — dissolution; yati — goes; deha-bhrt — the embodied; tada — at that time; uttama-vidam — of the great sages; lokan — the planets; amalan — pure; pratipadyate — attains.

Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
When one dies in the mode of goodness, he attains to the pure higher planets of the great sages.

Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
One in goodness attains higher planetary systems, like Brahmaloka or Janaloka, and there enjoys godly happiness. The word amalan is significant; it means “free from the modes of passion and ignorance.” There are impurities in the material world, but the mode of goodness is the purest form of existence in the material world. There are different kinds of planets for different kinds of living entities. Those who die in the mode of goodness are elevated to the planets where great sages and great devotees live.