Strictly speaking, the atmosphere never really ends, it gets thinner and thinner, but scientists have agreed to a limit of 10,000 km (6200 mi) for the outermost layer of Earth's atmosphere, the Exosphere.
NASA discusses the various parts of Earth's atmosphere at the link below:
https://www.nasa.gov/miss...osphere-layers2.html