Short Answer:
According to my rough calculations at the present rate that Earth is losing its atmosphere into space, it should take over a trillion years - 1,000,000,000,000 years - for Earth to lose all its atmosphere.
Long Answer:
Planetary retention of atmosphere is discussed in Habitable planets for Man Stephen H. Dole, 1964.
https://www.rand.org/content/dam/rand/pubs/commercial_books/2007/RAND_CB179-1.pdf
Pages 34 to 35 discuss a rough formula for estimating how long a planet can retain a particular gas in its atmosphere. The amount of time it takes for a planet or other world to retain a gas in its atmosphere depends on the ratio of the world's escape velocity (NOT its surface gravity) divided by the root-mean-square velocity of atoms of that gas in the escape layer of the atmosphere.
Gases escaped from the atmosphere in the exosphere of the atmosphere, the outermost layer where the gases are almost a rarified as in interplanetary space.
The root-mean-square velocity of a gas in the exosphere depends on the mass of an atom and its temperature. The lighter an atom is, the faster its velocity will be at a specific temperature. The temperature of gases in an exosphere doesn't depend on the total amount of stellar radiation, but apparently only on the amount of high ultraviolet radiation. So the cooler a star is, and the less ultraviolet it emits, the lower the escape velocity necessary to retain a gas for a certain amount of time.
Table 5 on page 35 gives the amount of time it will take for the amount of gas in an atmosphere to fall to only 1/e, or 0.3678 of the original amount.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is one, the amount of gas will fall to 0.3678 of the original amount instantly.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is two, the amount of gas will fall to 0.3678 of the original amount instantly.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is three, the amount of gas will fall to 0.3678 of the original amount in a few weeks.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is four, the amount of gas will fall to 0.3678 of the original amount in several thousand years.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is five, the amount of gas will fall to 0.3678 of the original amount in about a hundred million years.
If the ratio of the escape velocity divided by the root-mean-square velocity of that gas in the exosphere is six, the amount of gas will fall to 0.3678 of the original amount in about an infinite length of time.
Page 15 says that humans need a partial pressure of oxygen of 60 to 400 millimeters of mercury (mmHg) to survive. At sea level on Earth the pressure of oxygen is 160 mmHg. If it fell to 0.3678 of that it would fall to about 58 mmHg.
On page 54 Dole says that the temperature in Earth's exosphere varies between 1000 degrees K and 2000 degrees K. Dole says that at 1000 K the velocity of atomic oxygen would be 1.25 kilometers per second. And Dole says that if a world has an escape velocity of five time that, or 6.25 kilometers per second, it will retain 0.3678 of its original oxygen for about a hundred million years.
The escape velocity of Earth is about 11.186 kilometers per second. Six times 1.25 kilometers per second is 7.5 kilometers per second. So Earth should be able to retain atomic oxygen with a temperature of 1000 K for an infinite period.
But atomic oxygen in the exosphere can reach temperatures as high as 2000k. As long as the speed at 2000 K is slower than 1.8643 kilometers per second Earth can retain the hottest exosphere oxygen for an infinite period. As long of the speed at 2000 K is is lower than 2.2372 kilometers per second, Earth can retain 0.3678 of even the hottest atomic oxygen for about one hundred million years.
There are other effects which can cause atmospheric loss.
Earth looses several hundred tons of atmosphere into space each day.
https://earthobservatory.nasa.gov/images/144386/toward-mapping-the-atmospheres-escape-from-earth
If that is 100 to 1,000 tons per day, the loss rate will be about 365.25 to 3,625 tons per year, 3,625 to 36,525 tons per decade, 36,525 to 365,525 tons per century, 365,250 to 3,652,500 tons per millennium, 3,652,500 to 36,525,000 tons per 10,000 years, 36,525,000 to 365,250,000 tons per 100,000 years, 365,250,000 to 3,652,500,000 tons per million years, 3,652,500,000 to 36,525,000,000 tons per ten million years, 36,525,000,000 to tons per 365,250,000,000 hundred million years, and 365,250,000,000 to 3,652,500,000,000 tons per billion years.
365,250,000,000 tons would be 3.6525 times 10 the 11th power tons, and 3,652,500,000,000 tons would be 3.6525 times 10 to the 12th power tons, lost in a billion years.
Earth's atmosphere has a mass of about 5.15 times 10 to the 18th power kilograms. A kilogram is about 0.00110231 tons. So the mass of Earth's atmosphere is about 0.005676896 times 10th to the 18th power tons, or 5.676896 times 10 to the 15th power tons.
So at the current rate of atmospheric loss it should take about 1,554 to 15,542 times a billion years for the Earth to lose its atmosphere.