Shaykh Salih al-Fawzan explains that performing wudū and praying two rakaʿāt as repentance is reported in hadith, but it is not obligatory. Repentance is valid at any time, with or without this prayer, as long as it is sincere.
My colleague said to me, if you want to repent, then go and perform wudūʿ and pray two rakaʿāt, and this action is called ‘Ṣalāt al-Tawbah’. Is this action correct and is there a prayer for repentance?
Yes, this has been reported in a ḥadīth. So if a individual performs wudūʿ, prays two rakaʿāt and repents to Allah ﷻ , this is perfecting [the repentance] and not an obligation. For if you were to repent to Allah ﷻ without [performing] the prayer, or wudūʿ and during any time in the day or night, indeed Allah ﷻ will accept the repentance of his servants at any time and state.