Language:
كتاب التوحيد
97  
Oneness, Uniqueness of Allah (Tawheed)
(15)
Chapter: “…And Allah warns you against Himself…”
(15)
باب قَوْلِ اللَّهِ تَعَالَى {‏وَيُحَذِّرُكُمُ اللَّهُ نَفْسَهُ‏}‏
Sahih al-Bukhari 7404

Narrated Abu Huraira:

The Prophet (ﷺ) said, "When Allah created the Creation, He wrote in His Book--and He wrote (that) about Himself, and it is placed with Him on the Throne--'Verily My Mercy overcomes My Anger.'"

حَدَّثَنَا عَبْدَانُ، عَنْ أَبِي حَمْزَةَ، عَنِ الأَعْمَشِ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ لَمَّا خَلَقَ اللَّهُ الْخَلْقَ كَتَبَ فِي كِتَابِهِ ـ هُوَ يَكْتُبُ عَلَى نَفْسِهِ، وَهْوَ وَضْعٌ عِنْدَهُ عَلَى الْعَرْشِ ـ إِنَّ رَحْمَتِي تَغْلِبُ غَضَبِي ‏"‏‏.‏
Reference : Sahih al-Bukhari 7404
In-book reference : Book 97, Hadith 33
USC-MSA web (English) reference : Vol. 9, Book 93, Hadith 501
  (deprecated numbering scheme)