It is considered one of the Wonders of the Medieval World, but not one of the classical list of Seven Wonders compiled by the Greeks for the Ancient World, because they were unaware of its existence. "It", is the Great Wall of China, which in reality is not a single wall, nor even of a single dynasty.
The various sections of the Great Wall, were all built with one purpose in mind - keeping out invaders. Historically, the first section is reported to have gone up in 208B.C. in the Qin Dynasty, to protect a group of territories. It was made of packed earth, with watchtowers at intermittent spaces. But this section is not actually part of the Wall we see today, and in fact, has deteriorated to not much more than a long mound with one end at the east, on the edge of North Korea.
A major portion of the structure was built in stages and sections by various rulers during the Han and Sui Dynasties, as well as the Ten Kingdom period, all of which covered the first 1200 years A.D. These were constructed in the same way as the Qin portion, with packed earth creating walls that held watchtowers meant more as a warning system, than the defense of any primary city or settlement.
What we know as the Great Wall today, was built almost entirely in the Ming Dynasty which lasted from 1368-1640A.D. The prime period of construction was 1560-1640, when techniques employed included using stones for the sides and top to reinforce the Wall's defensive properties.
When all was said and done, there existed a snake-like structure that curved and climbed and slid down mountains, for a length of over 4,100 miles.