When the Earth is the most tilted away or towards the Sun.
The days when this happens are called:
• Summer solstice (the longest daytime of the year)
• Winter solstice (the shortest daytime of the year)
Solstice happens around June 21 and around December 21 each year.
See this animation for why it happens: