Buddhist cosmology recognizes a hierarchy of heavens (svarga) comprising the six heaven realms of the "world of the senses" (kāmaloka) inhabited by their respective gods, and the various heavens of the pure form and formless worlds inhabited by the various classes of higher gods known as brahmās. These heavens are places where any being can potentially be reborn. Existence in these heavens is essentially the fruit of wholesome (kuśala) or meritorious (puṇya) karma (action), and is exceedingly pleasant. Indeed, in the higher heavens there is a complete absence of physical and mental pain.
Rebirth in the heaven realms of the world of the senses is a result of the practice of generosity (dāna) and good conduct (śīla), while rebirth in the higher brahmā heavens is a result of the development of sublime peace and wisdom through the practice of calm and insight meditation. While life in these heaven realms is long and happy, it must eventually come to an end with the exhaustion of the good karma of which it is the fruit. Rebirth in a lower and less pleasant realm is then a distinct possibility. To this extent, heavenly existence is not entirely free of duḤkha (suffering) and falls short of the ultimate Buddhist goal of nirvĀṆa, which constitutes a complete and final freedom from the sufferings of the round of rebirth. Nonetheless, to be reborn in one of these heaven realms has often been presented and viewed, even in some of the earliest Buddhist texts (such as the Sigālovāda-sutta), as forming a step in the right direction and an intermediate goal on the way to nirvana. The goal of rebirth in heaven has thus been considered an appropriate aspiration of especially the Buddhist laity, but also anyone else who finds the demands of the practice that leads to nirvāṇa daunting. The underlying outlook here is connected with the notion of the gradual and inevitable decline of the Buddha's teaching, which means that the further removed we are in time from the Buddha himself, the harder it becomes to reach the ultimate goal. Thus, even the great fifth-century monastic commentator of the TheravĀda tradition, Buddhaghosa, writes at the conclusion of his manual of Buddhist theory and practice, Visuddhimagga (The Path of Purification), that he hopes not for nirvāṇa in his lifetime but to experience the joys of rebirth in the Heaven of the Thirty Three and subsequently to attain nirvāṇa having seen and been taught by the next buddha, Maitreya (Pāli, Metteyya).
In certain MahĀyĀna sources the pure lands of buddhas, while technically distinct from the heavens described above, perform a religiously analogous function. Rather than struggle for enlightenment here and now, far removed from the Buddha in time and space, and in circumstances that are somewhat unpropitious, it is better to aspire to be reborn in a pure land such as Sukhāvatī, the Realm of Bliss of the Buddha AmitĀbha/Amitāyus, where in the presence of a living buddha conditions are more conducive and enlightenment almost a certainty.
Reynolds, Frank E., and Reynolds, Mani B., trans. Three Worlds According to King Ruang: A Thai Buddhist Cosmology. Berkeley: University of California Press, 1982.
Sadakata, Akira. Buddhist Cosmology: Philosophy and Origin. Tokyo: Kosei, 1997.