Mercury is the smallest and also the 2nd closest planet to the Sun (including Pluto). It takes around 88 days for it to fully rotate around the Sun. It is the shortest period of time that a planet rotates around the sun. It is also the hottest planet in our solar system.
Earth on the other hand is the 3rd closest planet to the sun. It is the 5th closest planet to the sun (Including Pluto). It takes Earth 365 days to fully rotate around the giant star in our solar system. Earth is the 4th hottest planet and it happens to be the perfect amount of heat and cold to be habitable for life.