A man kissed a woman, then came to the Messenger of Allah ﷺ and told him about it. So this verse was revealed to him, "And establish prayer at the two ends of the day and at the approach of the night. Indeed, good deeds drive away bad deeds. That is a reminder for those who remember." [Hud 11:114]The man asked, "Is this for me?"He replied, "It is for whoever among my community acts upon it."
أن رجلا أصاب من امرأة قبلة، فأتى رسول الله ﷺ، فذكر ذلك له، فأنزلت عليه: {وأقم الصلوة طرفي النهار وزلفا من اليل إن الحسنت يذهبن السيئات ذلك ذكرى للذاكرين} قال الرجل: ألى هذه؟ قال: لمن عمل بها من أمتي.
Bukhari related it in the tafsir (4687), and Muslim in the repentance chapter (40:2763), both through the route of Sulayman Taymi, from Abu Uthman, from Ibn Masud, and he mentioned it. The wording is Bukhari's, and Muslim did not present the full wording for this chain, but rather referred back to the hadith before it.