(2) بَاب وُجُوبِ صَوْمِ رَمَضَانَ لِرُؤْيَةِ الْهِلَالِ وَالْفِطْرِ لِرُؤْيَةِ الْهِلَالِ وَأَنَّهُ إِذَا غُمَّ فِي أَوَّلِهِ أَوْ آخِرِهِ أُكْمِلَتْ عِدَّةُ الشَّهْرِ ثَلَاثِينَ يَوْمًا
Abu Huraira (Allah be pleased with him) narrated that the Messenger of Allah (may peace he upon him) made a mention of the new moon and (in this connection) said:
Observe fast when you see it (the new moon) and break fast when you see it (the new moon of Shawwal), but when (the actual position of the month is) concealed from you (on account of cloudy sky), then count thirty days.
Reference: Sahih Muslim 1081 d
In-book reference: Book 13, Hadith 23
USC-MSA web (English) reference(deprecated numbering scheme): Book 6, Hadith 2381