For an obligatory fast such as Ramadan, the intention must be settled in the heart during the night before dawn (Fajr), based on the Prophet's teaching that deeds are only by intentions. The intention is an act of the heart and does not need to be spoken aloud; simply rising for suhoor with the purpose of fasting is itself an intention. According to many scholars a single overall intention at the start of Ramadan suffices for the whole month unless the fasting is interrupted (for example by travel or menstruation), while others recommend renewing it each night to be safe. For voluntary fasts, the intention may be formed even after dawn as long as one has not eaten or drunk.
Q&A · Fasting
When must I make the intention (niyyah) to fast, and does one intention cover the whole of Ramadan?
Evidence — the daleel
Sahih al-Bukhari 1 ṢaḥīḥSahih Muslim 1907 Ṣaḥīḥ
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.