Sputnik 1 orbited the Earth for three months; Sputnik 2 for nearly six months. Explorer 1 stayed in orbit for twelve years, but the fourth artificial satellite, Vanguard 1, is still flying today.
How long an orbiting satellite stays up depends on the size of the satellite and the amount of rocket force used to put it in the sky. The further up you put the satellite, the longer it will stay up. Orbital decay will eventually pull it back down to Earth thanks to things like atmospheric drag.
For that reason, the very first artificial satellites to go into Earth orbit did not last very long. Sputnik 1, the first artificial satellite, burned up three months after it was launched. Sputnik 2 (the satellite containing the first space dog, Laika) was in orbit for half a year before it too came crashing down. At their highest points, neither of these satellites got further than 1700 kilometres above the planet’s surface.
In contrast to the first Soviet satellites, the first American satellites were very small: Explorer 1 was one sixth the mass of Sputnik 1 and one thirty-sixth the mass of Sputnik 2. It lasted for twelve years, only crashing back to Earth in March 1970. But the second American satellite, Vanguard 1, was truly tiny – just 1.47kg – and was shot up by a three-stage rocket that pushed it further than any of the preceding satellites: at its furthest away from the planet, it is nearly four thousand kilometres high. (All four of these satellites had elliptical orbits, by the way, so their altitude varies considerably over the course of a rotation.)
Vanguard 1 is sufficiently high, and sufficiently small, that it remains in the sky today – more than sixty years after it was launched. If I had a sufficiently powerful telescope I could have spotted it flying overhead on the morning that I’m writing this sentence. You can track it too via the second link below.
Vanguard 1 isn’t the only orbiting body from that launch, by the way: the third stage of the rocket is still orbiting too. Vanguard 1 is not expected to crash back down to Earth for another 180 years. Most satellites today are either deliberately de-orbited or they are pushed up into a higher graveyard orbit.