Our Earth receives all its heat mostly from the Sun. Since Earth is spherical in shape, sun rays fall on different places on Earth at different angles. This is the reason why every part of our planet is not equally hot. On the equator, the sun rays fall straight where as on either side of the equator they fall at an angle.
So that would mean that the sun rays falling straight on earth are hotter than the rays falling in a slanting way. Have you wondered why? The answer is straightforward.
The rays that fall obliquely travel a longer distance in the atmosphere. The dust particles, water, gases and many other things present in the atmosphere absorb heat from these rays. When the rays travel longer to reach a particular area, more is the heat lost by them on the way. Therefore, that area they fall on receives less heat.
Equator and places very close to it receive straight falling sun rays. Straight rays cover the short distance to reach earth and, therefore, don’t lose much heat on the way. Therefore, the area that they fall on receives a lot of heat.
While the temperature of a place is mostly decided by sun rays, height of place above sea level and its distance from the sea shore also have some role to play.