The Ashrama system is designed according to the stages of life viz. student, householder, retired and renounced life according to age and are related to the proper combination of four Purushartha viz. Dharma, Artha, Kama and Moksha.
Though there is no strict rule that one can take Sannyasa only after Vanaprasthashrama. One can take Sannyasa from any Ashrama and at the instantaneous moment which distaste for it dawns on him according to spiritual level.
From Jabala Shruti/Upanishad (verse 4):
Sanskrit verse quoted from Sanskrit Documents
अथ हैनं जनको वैदेहो याज्ञवल्क्यमुपसमेत्योवाच
भगवन्संन्यासं ब्रूहीति । स होवाच याज्ञवल्क्यः ।
ब्रह्मचर्यं परिसमाप्य गृही भवेत् । गृही भूत्वा वनी
भवेत् । वनी भूत्वा प्रव्रजेत् । यदि वेतरथा
ब्रह्मचर्यादेव प्रव्रजेद्गृहाद्वा वनाद्वा ॥
अथ पुनरव्रती वा व्रती वा स्नातको वाऽस्नातको
वोत्सन्नग्निको वा यदहरेव विरजेत्तदहरेव प्रव्रजेत् ।
तद्धैके प्राजापत्यामेवेष्टि,न् कुर्वन्ति । तदु तथा न
कुर्यादाग्नेयीमेव कुर्यात् ॥
English translation quoted from Vedanta Spiritual Library:
Then Janaka, the king of the Videhas (respectfully) approached Yajnavalkya and requested him: 'Revered Sir, expound (to me) the (tenets of) renunciation (Sannyasa)'. He (Yajnavalkya) then replied: 'After completing the period of disciplined studentship (brahmacharya) one may become a householder. After being a householder he may become a forest-dweller (i.e., become a Vanaprastha). Having become a Vanaprastha he may renounce the world (and thus become a mendicant monk). Or, alternately, he may embrace renunciation from brahmacharya itself, or from the (stage of a) householder, or from the forest(-life of a Vanaprastha). (It can also be that) a person may renounce worldly life that very day on which distaste for it dawns on him, whether he is one not observing the vows (before the stage of renunciation) or observe them, whether he has undergone the prescribed ablution on completing the disciplined studentship or not, whether he is one who has discontinued maintaining the sacred fire at the death of his wife (utsannagni) or is one who does not maintain (for other causes) the sacred fire (anagnika).
So, when one take Sannyasa from Brahmacharya, Grihashtha or Vanaprashtha. More precisely, one can take Sannyasa on very that day/moment when absolute Vairagya is obtained!
This is also supported in Adhyaya-3, Pada-4 of Brahma Sutra.
Note: There are also other Upanishads with similar names like Jabali Upanishad or Bhasma Jabal Upanishad. This is Jabal Upanishad quoted as mentioned and used by Acharyas in their Bhashya of Prashthanatrayi.