Language:
كتاب الطلاق
68  
Divorce
(21)
Chapter: "Those who take an oath, not to have sexual relations with their wives, must wait four months."
(21)
بَابُ قَوْلِ اللَّهِ تَعَالَى: {لِلَّذِينَ يُؤْلُونَ مِنْ نِسَائِهِمْ تَرَبُّصُ أَرْبَعَةِ أَشْهُرٍ} إِلَى قَوْلِهِ: {سَمِيعٌ عَلِيمٌ} {فَإِنْ فَاءُوا} رَجَعُوا
Sahih al-Bukhari 5289

Narrated Anas bin Malik:

Allah's Messenger (ﷺ) took an oath that he would abstain from his wives, and at that time his leg had been sprained (dislocated). So he stayed in the Mashruba (an attic room) of his for 29 days. Then he came down, and they (the people) said, "O Allah's Messenger (ﷺ)! You took an oath to abstain from your wives for one month." He said, "The month is of twenty nine days."

حَدَّثَنَا إِسْمَاعِيلُ بْنُ أَبِي أُوَيْسٍ، عَنْ أَخِيهِ، عَنْ سُلَيْمَانَ، عَنْ حُمَيْدٍ الطَّوِيلِ، أَنَّهُ سَمِعَ أَنَسَ بْنَ مَالِكٍ، يَقُولُ آلَى رَسُولُ اللَّهِ صلى الله عليه وسلم مِنْ نِسَائِهِ، وَكَانَتِ انْفَكَّتْ رِجْلُهُ فَأَقَامَ فِي مَشْرُبَةٍ لَهُ تِسْعًا وَعِشْرِينَ، ثُمَّ نَزَلَ فَقَالُوا يَا رَسُولَ اللَّهِ آلَيْتَ شَهْرًا‏.‏ فَقَالَ ‏ "‏ الشَّهْرُ تِسْعٌ وَعِشْرُونَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 5289
In-book reference : Book 68, Hadith 38
USC-MSA web (English) reference : Vol. 7, Book 63, Hadith 212
  (deprecated numbering scheme)