The answer isn't as simple as it may seem. The US government awards wings to astronauts who have flown in a powered vehicle to a height of 50 nautical miles (about 80 km) above Earth's surface. The rest of the world recognizes a spaceflight boundary of 100 kilometers; but even at this altitude, a spacecraft can circle Earth only a few times before its orbit decays due to atmospheric drag. To maintain orbit for a day or longer, a spacecraft must attain an altitude of at least 80 nautical miles (about 130 km). This may sound high up, but if Earth were a peach, then this altitude would be right at the top of its fuzz.
Even at an altitude of 300 kilometers, there's more than enough atmosphere to make knowledge of its effects essential. Beyond the drag it causes on spacecraft, the atmosphere at that height has a different composition than the air at sea level. Significantly, it contains a much higher percentage of atomic oxygen. Unlike molecular oxygen, which consists of two oxygen atoms bonded together, atomic oxygen is highly reactive and will attack spacecraft components susceptible to oxidation (rust), weakening and eroding them.
In the deep space beyond Earth's atmosphere, a near-perfect vacuum exists, but this type of environment can cause problems as well, such as out-gassing (the emission of gases from within a spacecraft) and off-gassing (the emission of gases from the surface of a spacecraft). Both of these conditions can cloud sensors and interfere with instrument readings. The near-perfect vacuum of space can also cause cold-welding, which is a fusing together that occurs when parts manufactured from similar metals come into contact in a vacuum.
Gravity can be another confusing aspect of the space environment. The idea that vehicles in Earth orbit operate in zero gravity is a common misconception. Let's say that you could build a tower as tall as the typical low Earth orbit (about 300 km). Standing at the top of the tower, you would experience a gravitational pull equal to about 91 percent of Earth's gravitational force at sea level. The reason that astronauts in orbit float around is not that they're weightless; the reason is that they're in free fall. Like all objects in orbit, astronauts are falling all the time, but they don't hit the ground because the ground is always curving away from them. (‘The Bedside Baccalaureate’, edited by David Rubel)