Yes, القرآن permits leaving منى on the 12th after stoning all three الجمرات, but you must depart before sunset — if sunset catches you in منى, you must stay and stone on the 13th.
Yes, القرآن explicitly permits early departure from منى: 'Whoever hastens [departure] on the second day (12th), there is no sin upon him; and whoever delays, there is no sin upon him — for the one who has taqwa (God-consciousness)' (القرآن 2:203). This early departure is called Nafr Awwal (first departure), while staying until the 13th is called Nafr Thani (second departure).
To leave on the 12th, you must: complete the stoning of all three الجمرات on the 12th in the correct order (after Dhuhr عند the majority), and then depart from منى before sunset. The critical deadline is sunset — if the sun sets while you are still within the boundaries of منى, the majority of scholars say you become obligated to stay the night and perform the stoning on the 13th as well.
Both options are equally valid with no sin attached to either choice. However, staying until the 13th and completing all the rites is considered more virtuous by the majority of scholars, as النبي (صلى الله عليه وسلم) stayed until the 13th. Practically, early departure on the 12th also means less crowding when performing the farewell الطواف in مكة, which is a consideration for large groups with fixed travel schedules. If you choose Nafr Awwal, do not delay after stoning — proceed to depart منى promptly to avoid being caught by sunset.
فَمَن تَعَجَّلَ فِي يَوْمَيْنِ فَلَا إِثْمَ عَلَيْهِ وَمَن تَأَخَّرَ فَلَا إِثْمَ عَلَيْهِ
Whoever hastens departure from منى in two days, there is no sin upon him; and whoever delays, there is no sin upon him — for the one who fears Allah.
Source: Ibn Kathir, Tafsir al-القرآن al-Azim; al-Nawawi, Al-Majmu
Whoever hastens departure from منى in two days, there is no sin upon him; and whoever delays, there is no sin upon him — for the one who fears Allah.
Al-Baqarah (2:203)