Atlas was the Titan god of Endurance. There are a couple of myths surrounding Atlas and his task of holding up the heavens.
In the first myth, Atlas led the Titans in a rebellion against Zeus. When the Titans lost, Atlas was sentenced to hold the heavens on his shoulders for eternity. The second myth states that Atlas was commissioned by Zeus to, as the guardian of the pillars, hold the, up to separate the earth and sky. Aside from holding up the heavens, Atlas was responsible for teaching humans astronomy (...astrology?) He taught sailors how to read the stars to chart their journeys and farmers how to look to the starts to measure the changing of the seasons.
In one myth, Herakles went to Atlas during his quest for the Golden Apples. Atlas tricked Herakles into holding up the heavens for a time.
There are a few interpretations to the myth of Atlas and his responsibilities, not just why he holds the pillars but, also, what the pillars actually are. Some myths say that the pillars were mountains located within the earth goddess herself while other myths state that Atlas actually holds the earth in the sky and keeps it from being lost in the heavens.
These ideas are meant, I believe, to be figurative. Yes it's true that there are specific gods meant to personify specific things like Gaia being mother earth and Apollo being the sun god, but Apollo also drives the sun chariot so he can't possibly be both. I don't know if ancient Greeks actually believed that Atlas was in the sky holding up the earth or inside of the earth holding up the mountains and separating them from the sky. I mean Hades was the god of the underworld which was supposed to be located within the earth but Gaia is the goddess of the earth so essential that would mean that Hades and all of the souls he'd gathered lived inside of Gaia. Same with Uranus, he's the sky god, but I don't know if he was actually the sky. All of the gods, I believe, had corporeal, humanoid, bodies. Except maybe Kaos. I know that in the beginning when there was just Kaos, everything was formless so I don't imagine that Kaos himself would have had a form. It is a head scratcher, though. I'm pretty sure that stuff like that is meant to be taken figuratively not literally. I think back then people just chose not to examine things like that too closely. One of the main reasons I like Ovid so much is because he did examine things like that. Inconsistencies. You get them in every religion, I'm sure.