Actually, the temperature of the sun itself is relatively constant. However, depending on where you live on the surface of the earth, the average daytime temperatures in summer at that place seem quite different from those of winter. That is probably the basis of your question. So let’s explore this question from the perspective of people living on the surface of the earth.
For people living near the equator, the temperature is usually hot all of the time. For those living near the poles, it is cold most of the time. For those living in between, the temperatures range between cold and hot during the course of a year.
For those living somewhere between the equator and the south pole, such as in Australia or Bolivia or Angola, the temperatures in winter are hotter and the temperatures in summer are colder. For those living somewhere between the equator and the north pole, such as in China, Romania, or the United States, the summer is hotter and the winter is colder. A person living in this region might ask why the sun is so hot in summer. However, a person living south of the equator might ask the opposite question! If we understand the relationship of the earth to the sun, we can answer the question for people living in both locations.
The earth’s axis of rotation is tilted with respect to its orbit around the sun. For part of the year, the north pole is slightly tilted toward the sun, and then slightly away from the sun for the other part of the year. This produces hotter temperatures at the surface of the earth north of the equator for part of the year and colder temperatures for the other part of the year. You can see a diagram that shows this arrangement at http://www.planetseed.com/relatedarticle/sun-and-earth-and-temperature-change
For a person in China, for example, the sun would be more directly overhead at noon in summer and would be closer to the horizon at noon in the winter. You can see a diagram that shows this arrangement at http://www.planetseed.com/node/20125
This means that the rays of the sun would be more direct in the summer and would be more inclined during the winter. The result is that a person living in China senses that summer is hotter and winter is colder.
For a person in Bolivia, the situation would be the opposite.
You can find more details about this explanation at
By the way, the distance from the earth to the sun changes during the year, because the earth’s orbit is not a perfect circle. However, this distance change is not enough to make a big difference in the temperatures at the surface of the earth.