The earth constantly receives heat radiation from the sun and gets warmed up. Why does the earth not get as hot as the sun?

Because the earth is located at a very large distance from the sun, hence it receives only a small fraction of the heat radiation emitted by the sun. Further, due to loss of heat from the surface of the earth due to convection and radiation also, the earth does not become as hot as the sun.