This obviously looks like an afterthought explanation but here is what I found : The magazine, Star Wars Insider Issue 62, explains that R2's manufacturers at Industrial Automation had limited their factory warranty on astromech rockets to about 20 years, which would explain why R2 doesn't have his rockets in the Original Trilogy.
generalanswers.org
I was dubbing on that reference because I don't have any copy of Star Wars Insider Issue 62.
I also found the same text in a cached Wikipedia page and that section has been removed long ago.
(see Wikipedia Talk on R2-D2 )
Anyway, from the Industrial Automaton Wookieepedia article there's a remark on this limitation of the warranty that cite holonetnews as reference: RORDIS CITY, NUBIA - Rescinding previous consumer documentation that guaranteed a "lifetime" of reliability in their after-market astromech hover rockets, Industrial Automaton has now capped the warranty at 20 standard years.
This decision affects all optional R2, R3 and R4-adapted leg-bracket and barrel-housed propellant rocket systems.
[...]
scifi.stackexchange.com/users/45/DavRob60
Another possible reason could be that the rockets (even if they had fuel) weren't powerful enough to lift R2-D2 in the gravitational field of Tatooine (which, being a rather large planet, is likely to have relatively high gravity).
If I remember Attack of the Clones correctly that scene took place on an asteroid or planetoid, thus in low gravity.
Rockets powerful enough to lift an R2-D2 in 1G (1 Earth gravity acceleration) -
and it's quite likely
Tatooine had higher than that - would be rather large and bulky.
Thrusters for (near) zero gravity to propel the same mass can be a lot smaller and thus easier to fit into a droid.
As the R2-D2 was designed for use in zero gravity primarily (space ship maintenance and repair, etc...)
the designers aren't likely to have designed it with atmospheric flight in a high-G environment in mind.
scifi.stackexchange.com/users/1032/jwenting
It's probable that, as his focus shifted away from starship maintenance (with its requirement for zero-g mobility) and toward 'Rebel hacker/awesomebot' R2 was modified to remove the rockets.
It's also possible that, as a member of the rebellion against the government of the time (instead of as a robot in the service of the present government, as in the prequel trilogy) the fuel was hard to come by.
R2 can't have a lot of storage space for fuel, and I'd be willing to bet that his flight capabilities either require a significant amount of his internal power OR need a separate fuel source.
If it is fuel, then it's certainly likely that he had none at the time - either because the Rebellion didn't think it would be needed or because it had been removed by Jabba's people (why would a drink server need it?).
Keep in mind that there IS evidence for R2 having flight capabilities in Empire Strikes Back (unless you think the bottom of a lake in a SWAMP is a good environment for a wheeled robot, and that it would be level enough for his sensor probe to maintain a flat path).
scifi.stackexchange.com/users/656/Jeff
Among the plausible reasons: because the small repulsorlift engines in R2 might not work over "off the cliff" surface (either not enough power, or problems with control).
It was a faster way down :)
I don't know of a canonical answer.
scifi.stackexchange.com/users/976/DVK-on-Ahch-To
Since I first watched Revenge of the Sith, I thought a direct answer to this question was given when R2 spits out a full load of petroleum-like fluid and uses his thrusters to ignite it and fry a bunch of battle droids on Dooku's flagship.
It is even clear that he used all his fuel for this, because the thrusters cough and turn off right after.
Why he never refills can be explained in various ways.
Maybe the tank was not refillable as that fuel quantity was intended to last for decades.
Or that particular fuel was never available again after the fall of the Republic.
scifi.stackexchange.com/users/7866/Giuseppe
This is very briefly covered in a footnote in the (Disney-canon)
Star Wars novel Return of the Jedi - Beware the Power of the Dark Side .
Somewhere, deep in his memory banks, R2 remembers a time when he could have fired his rocket thrusters and abandoned ship gracefully.
But they haven’t worked in ages and his warranty is long, long expired.
scifi.stackexchange.com/users/20774/Valorum
Perhaps, in the RotJ secne, they were disabled or removed despite the fact that R2 had a restraining bolt.
The foreman robot in Jabba's palace recognized R2 as being a troublemaker and could have accounted for him being wily enough to try to circumvent the restraining bolt at some point.
Furthermore, I would imagine that they would be a limited use item as R2 did not use them for a very extended period on Geonosis.
scifi.stackexchange.com/users/11960/user11960
According to Wookieepedia : R2-D2, during the Clone Wars, utilized a Brooks Propulsion rocket booster, which he used to escape and, in the case of the Battle of Coruscant, offensively.
After the Clone Wars, however, Brooks Propulsion Devices, the company responsible for the development of his boosters, was shut down, and his rocket boosters were eventually damaged and thus could not be repaired.
Despite this, however, R2 hardly regretted the loss of his ability to fly.
scifi.stackexchange.com/users/28126/coppo
In  Return of the Jedi :   Artoo butts the golden droid over the edge and steps off himself, tumbling toward the sand.   But in  Attack of the Clones :   ARTOO uses his rocket jets to fly up and into the factory.   Why didn't R2-D2 use his jets in RotJ instead of ending feet up in the sand?  Update:  I am looking for  an in-universe explanation .
Why did R2-D2 not fly in Return of the Jedi?
scifi.stackexchange.com
<star-wars><return-of-the-jedi><attack-of-the-clones>
scifi.stackexchange.com/questions/2298
scifi.stackexchange.com/users/143/Reinstate Monica - Goodbye SE
Theories as to the reason why R2-D2 may not have been able to fly include that the rockets may not have been powerful enough in the gravitational field of Tatooine, his rockets may have been removed, or fuel may have been scarce. There are several possible reasons why R2-D2 did not fly in Return of the Jedi: the rockets were not powerful enough, the rockets had been removed, he did not have fuel or the rockets were disabled.
There are several possible reasons why R2-D2 did not fly in Return of the Jedi: the rockets were not powerful enough, the rockets had been removed, he did not have fuel or the rockets were disabled.