From Sahih Muslim (Hadith 2515):
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)
Reference: Muslim 2515