Official sunrise is when the ‘upper limb’ of the rising sun first appears on the horizon, and official sunset it when the ‘upper limb’ of the setting sun disappears below the horizon.
The ‘upper limb’ is the very edge of the sun.
Some light can still be seen before sunrise and after sunset. This time is known as twilight and it starts and ends when the centre of the sun is 6° below the horizon.
Morning civil twilight starts when the rising sun’s centre is 6° below the horizon and ends at sunrise.
Evening civil twilight starts at sunset and ends when the setting sun’s centre is 6° below the horizon.