Atlas holds the world on his shoulders as a punishment handed down by Zeus. Atlas was a Titan involved with The Titanomachy, which was the war waged between the Titans and the Olympians that was eventually won by the Olympians.
After the Titan Kronos overthrew his father, Ouranos, the Titans ruled with Kronos as their leader. As a result, each of the male Titans joined with their sisters to make children. Kronos married his sister Rhea but his parents told him he was destined to be overthrown by one of his own children. This gave him the idea to swallow whole each of the children Rhea bore him, including Hestia, Demeter, Hera, Hades and Poseidon.
Rhea grieved for the loss of her children, and when she was close to having Zeus, she asked her parents for advice, which ultimately led to her giving Kronos a stone instead of the infant Zeus. Kronos unknowingly swallowed the stone, allowing Zeus to grow up and forcing Kronos to throw up all of his siblings. A war soon breaks out between the Olympians, led by Zeus and the Titans; however historians aren't sure exactly how it starts since that part of the story has been lost. What is known is that the war was a stalemate until the gods triumphed with the use of "older powers." As eternal punishment, Atlas must hold the entirety of the heavens on his shoulders.