Sunan an-Nasa'i, Volume 2, Book 13, Hadith 1249 (DarusSalam)

It was narrated that Abdullah bin Ja'far said: "The Messenger of Allah said: 'Whoever has doubt during his prayer, let him prostrate twice after he has said the taslim'".

أَخْبَرَنَا سُوَيْدُ بْنُ نَصْرٍ، قَالَ أَنْبَأَنَا عَبْدُ اللَّهِ، عَنِ ابْنِ جُرَيْجٍ، قَالَ قَالَ عَبْدُ اللَّهِ بْنُ مُسَافِعٍ عَنْ عُتْبَةَ بْنِ مُحَمَّدِ بْنِ الْحَارِثِ، عَنْ عَبْدِ اللَّهِ بْنِ جَعْفَرٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَنْ شَكَّ فِي صَلاَتِهِ فَلْيَسْجُدْ سَجْدَتَيْنِ بَعْدَ مَا يُسَلِّمُ ‏" ‏ ‏.‏

sunnah.com