This is what the hadith of Ibn Masʿud, may Allah be pleased with him, indicates: the Prophet, may Allah bless him and grant him peace, taught him the tashahhud and then said, “Then let him choose whatever supplication he wishes.” Accordingly, if someone asks us, “Should I supplicate after the salām or before the salām?” we say to him: “Supplicate before the salām, for this is what the Prophet, may Allah bless him and grant him peace, instructed. Moreover, so long as you are in prayer, you are conversing privately with your Lord; once you have said the salām, you have departed. Supplicating while you are conversing privately with your Lord is better than supplicating after you have departed.” This is a theoretical preference.
As for what some people do—supplicating every time they conclude with the salām, whether in an obligatory or voluntary prayer—there is no basis for it, and, to our knowledge, nothing of this nature has been reported from the Prophet, may Allah bless him and grant him peace, except when the Quraysh disbelievers placed a camel’s afterbirth upon him while he was prostrating. When he concluded the prayer with the salām, he raised his voice in supplication against them. (1) It may be said that he did this for a particular reason: to frighten them, since had he supplicated while praying, they would not have known of it.
As for citing as evidence the Prophet’s statement, when he was asked, “Which supplication is most likely to be answered?”—that is, closest to being answered—he, may Allah bless him and grant him peace, replied: “In the depths of the night and at the ends of the prescribed prayers.” (2) They say: the ends are after the prayer, based on the Prophet’s statement: “You glorify Allah, praise Him, and proclaim His greatness at the end of every prayer, thirty-three times.” (3)