Reference : Hisn al-Muslim 140

مَا مِنْ عَبْدٍ يُذنِبُ ذَنْباً فَيُحْسِنُ الطُّهُورَ، ثُمَّ يَقُومُ فَيُصَلِّي رَكْعَتَيْنِ، ثُمَّ يَسْتَغْفِرُ اللَّهَ إِلاَّ غَفَرَ اللَّهُ لَهُ
There is not any slave of Allah who commits a sin, then he perfects his purification and stands to pray two Rak'ahs of prayer, then seeks Allah's forgiveness, except that Allah will forgive him.

Reference:
Abu Dawud 2/86, At-Tirmidhi 2/257. Al-Albani graded it authentic in Sahih 
Abu Dawud 1/283.

Chapter: Upon committing a sin