The fasting person has to make up his fast if he breaks the fast when he is uncertain whether the sun has set, because Allaah says (interpretation of the meaning):
“then complete your Sawm (fast) till the nightfall”
and night begins when the sun sets. If he is certain that it is still day he should not break his fast until he is certain or thinks it most likely that the sun has set, because the basic principle is that it is still day, and that does not change unless there is certainty or strong probability.
The fasting person does not have to make up the fast if he eats or drinks when he is uncertain whether dawn has come, because Allaah says (interpretation of the meaning):
“and eat and drink until the white thread (light) of dawn appears to you distinct from the black thread (darkness of night)”
Allaah says “until … appears to you” which indicates that it is permissible to eat and drink before one is certain that dawn has come, and because he was certain that it was still night, so it is not haraam for him to eat until he becomes certain that dawn has come, because the basic principle is that it is still night.
See also the answer to question no. 38543.
And Allaah knows best.