It is very important to note that spending three or two nights, the 11th and 12th of Dhul-Hijjah, at Mina is wajib (requisite), according to Malik, Ash-Shafi`i and Ibn Hanbal. The Hanafi school regards sleeping at Mina as a Sunnah only. Pilgrims must return from Mina to Makkah before sunset of the 12th of Dhul-Hijjah.
Sheikh Sayyed Sabiq states in his well-known book, Fiqh As-Sunnah: “The three schools of Islamic law hold that the pilgrims must return from Mina to Makkah before sunset of the 12th of Dhul-Hijjah after throwing the pebbles.
However, the Hanafi school is of the opinion that pilgrims may return to Makkah before the dawn of the 13th of Dhul-Hijjah. Leaving after sunset is disliked for it is against the Sunnah. but one who does so incurs no penalty.