Look at the photo below
Here, we see sun above the horizon, but the sun is actually not above the horizon.
Infact:
We see sunrise 2 minutes before actual sunrise
We see sunset 2 minutes after sunset
This is because of atmospheric refraction
Explanation for Advanced Sunrise
Before Sunrise, sun is below the horizon
Sun's rays are coming from more dense air towards less dense air
This causes sun rays to refract and appear to come above the horizon
Our eyes see sun rays as a straight line, it appears to us that sun has risen but it has actually not yet risen
Explanation for Delayed Sunset
After Sunset, Sun is below the horizon
Sun's rays are coming from more dense air towards less dense air
This causes sun rays to refract and appear to come above the horizon
Our eyes see sun rays as a straight line, it appears to us that sun has not yet set
What about Flattening of Sun's Disc?
During sunrise and sun's set, shape of sun appears to be little flatter
This is also because of refraction of light (bending of light coming from sun to earth due to earth's atmosphere)