Why are some planets cold and some hot?
The temperature of a planet depends mostly on how close it is to the star it orbits. As you might imagine, the closer a planet is to a star, the hotter it will be.
Another factor is how hot the star is. A cooler red dwarf star won't heat a planet up as much as a hotter blue giant.
There are also things about the planet itself that affect its temperature. For example, planets get very hot when they first form, due to heat created by all the collisions and compacting. They hold this heat for millions or billions of years. Bigger planets hold their heat for longer. Earth is more than 4 billion years old and it still has a lot of heat in its core, which is slowly escaping through the planet's layers and helping to heat the surface.
The atmosphere makes a big difference to the surface temperature of a planet. An atmosphere acts as a kind of blanket. Earth gets cold at night but it does hold enough heat to prevent us all from freezing to death. Venus has a very thick CO2 atmosphere, so it holds heat extremely well (it's actually a runaway greenhouse effect). That's why Venus has the highest average temperature of all the planets in our Solar System. On the other hand, Mercury is closer to the Sun than Venus but it has no real atmosphere so its dark side loses heat very quickly.