Masruq and Sayyiduna al-Bara' (may Allah be pleased with him) both said that the Messenger of Allah (peace and blessings be upon him) said: "Fast upon sighting it (the new moon) and break the fast (celebrate Eid) upon sighting it, and if it is obscured for you, then complete thirty (days)." And, gesturing with his hand, he (peace and blessings be upon him) said: "The month is like this and like this," meaning twenty-nine (days).
Hadith Referenceالمعجم الكبير للطبراني / باب الباء / 1164