A megastructure is an artificial construct of enormous size. The term is informal but generally megastructures are at least a few thousand kilometers in size along one dimension. Megastructures appear most frequently in science fiction, though arguably the Great Wall of China is a megastructure. The Great Wall can be seen from low earth orbit, but so can highways, fields of crops, and large buildings. Low earth orbit is only 200 km (125 mi.) up so this makes sense. Megastructures are most frequently seen in science fiction, and it seems like only a matter of time until our civilization starts to build them. A megastructure is meant to be a contiguous, self-supported entity - that is, not composed of an aggregate of smaller constructs.
The most familiar fictional megastructure would be the Death Star. It was suggested that the Death Star was similar in size to the Moon. If so, it would be about 3,500 km (2,000 mi.) in size. Its core would be under a tremendous amount of pressure and would probably need to be solid rather than containing structural elements, as in the movies.
Globus Cassus, an abstract design project, proposed "unfolding" the Earth's matter into a series of rotating rings which we would then inhabit the inner surface of. A similar concept appears in Ian M. Banks Culture novels, where huge ring-shaped megastructures dozens of Earth diameters in size called "Orbitals" rotate quietly, their inner surfaces covered with hundreds of continents and lengthy oceans. In Larry Niven's Ringworld series, an even bigger ring is present - this ring goes all the way around the Sun with a surface covered in land. It is made of a fictional material called scrith with atomic bonds as strong as the bonds between protons and neutrons in the atomic nucleus. Scientists doing calculations on the necessary strength of this megastructure have found that it would indeed need to be about that strong.
Coming back closer to reality, a space elevator, a megastructure which could be built out of a material we can already make, albeit expensively and in small quantities - carbon nanotubes - would be about 50,000 km in length, extending all the way up to geosynchronous orbit. Such an elevator could be relatively thin, with a nanotube core ranging between only 1 and 10 cm in width. The higher portions of the elevator would need to be thicker to withstand impacts with space debris. There already exists a group, Liftport, which plans to build a space elevator by 2031. If they are successful, it could be the first true megastructure and would herald a revolution in space travel.