Sahih Muslim, Book 13, Hadith 21 (Muslim 2490)

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

Observe fast on sighting it (the new moon) and break (fast) on sighting it (the new moon), but if the sky is cloudy for you, then complete the number (of thirty).