If the sun is low above the horizon, the optical path of the light through the atmosphere is very long, and the atmosphere usually has a layered structure: different temperature gradients and pressure. Refraction of the light by these layers we are not able to detect the shift in their position due to atmospheric refraction. we can, however, see distortions in their shapes when they are near the horizon.During sunrise and sunset the sun is at near the horizon and refractive index of the atmosphere of the earth decrease with height. There is uneven bending of light through different layers results in flattening of shape of the sun.
Thus, Sun appears flattened at sunset and sunrise.