كتاب الصيام
13  
The Book of Fasting
(2)
Chapter: The obligation to fast Ramadan when the crescent is sighted, and to break the fast when the crescent is sighted, and that if it is cloudy at the beginning or end of the month, then the month should be completed as thirty days.
(2)
بَاب وُجُوبِ صَوْمِ رَمَضَانَ لِرُؤْيَةِ الْهِلَالِ وَالْفِطْرِ لِرُؤْيَةِ الْهِلَالِ وَأَنَّهُ إِذَا غُمَّ فِي أَوَّلِهِ أَوْ آخِرِهِ أُكْمِلَتْ عِدَّةُ الشَّهْرِ ثَلَاثِينَ يَوْمًا
Sahih Muslim 1080 d

'Ubaidullah narrated on the authority of the same chain of transmitters that the Messenger of Allah (ﷺ) made a mention of Ramadan and said:

The month may consist of twenty-nine days, and it may be thus, thus and thus, and (he further) said: Calculate it, but he did not say thirty.
وَحَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ سَعِيدٍ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عُبَيْدِ اللَّهِ، بِهَذَا الإِسْنَادِ وَقَالَ ذَكَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم رَمَضَانَ فَقَالَ ‏"‏ الشَّهْرُ تِسْعٌ وَعِشْرُونَ الشَّهْرُ هَكَذَا وَهَكَذَا وَهَكَذَا ‏"‏ ‏.‏ وَقَالَ ‏"‏ فَاقْدِرُوا لَهُ ‏"‏ ‏.‏ وَلَمْ يَقُلْ ‏"‏ ثَلاَثِينَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1080d
In-book reference : Book 13, Hadith 7
USC-MSA web (English) reference : Book 6, Hadith 2366
  (deprecated numbering scheme)