On the eleventh and twelfth, and on the thirteenth for those who stay, the pilgrim throws seven pebbles at each of the three jamarat. This is 21 pebbles each day. The order matters. He begins with the small jamrah, then the middle and then the large one (Sahih al-Bukhari 1751).
The time begins after the sun passes its zenith. Ibn Umar (may Allah be pleased with him) said: "We used to wait, and when the sun had passed the zenith we threw" (Sahih al-Bukhari 1746). The majority of scholars therefore require rami on these days to be after noon, while some, including a view in the Hanafi school for the last day, allow it before noon. Jabir also reported that the Prophet ﷺ threw after the sun passed the zenith on the days after Eid (Sahih Muslim 1299). Most scholars say that the time goes on until sunset.
Allah says: "And remember Allah during [specific] numbered days. Then whoever hastens in two days, there is no sin upon him; and whoever delays, there is no sin upon him, for him who fears Allah" (Quran 2:203). A pilgrim may leave Mina after rami on the twelfth, or stay for the thirteenth and throw again, and staying is better. Most scholars say that the departure must be before sunset, while the Hanafi school allows it until the dawn of the thirteenth.