Sujud al-sahw, the 'prostration of forgetfulness,' is two extra prostrations performed to correct an unintentional error in salah. It applies mainly to three situations: adding something that doesn't belong (an extra rak'ah, standing, or bowing), omitting an obligatory element (such as a tashahhud or a pillar performed out of order), and doubting how many rak'ahs one has prayed. The Prophet Muhammad taught that when in doubt, a worshipper should act on whatever number they are more confident of, complete the prayer accordingly, and then perform two prostrations before the final salam, so that if the prayer was actually complete the extra prostrations 'humiliate the devil,' and if it was short, they make up the deficiency. Jurists differ on the exact timing: the Hanafi school generally places sujud al-sahw after the salam in almost every case, while Shafi'i, Maliki, and Hanbali scholars distinguish between errors of omission (prostrate before salam) and simple doubt resolved by certainty (prostrate after salam). The prostrations themselves mirror ordinary sujud, followed by tashahhud and salam again. It is a mercy that keeps prayer valid despite ordinary human forgetfulness.
Q&A · Prayer
What is sujud al-sahw (the prostration of forgetfulness), and when should it be performed?
References
Sahih Muslim 571
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.