(Not sure whether this is best as an 'answer' or just a 'comment', but...)
So first of all I think your question pre-supposes a few things. For one we don't know that he only had 'days'; we don't know when the Convergence happened in relation to his feeding schedule. Watching his intro again (
), it appears that 3 weeks
pass between check-ups/feeding (woah). So at least, he had days; at most, he had up to 3 weeks (and that's assuming he didn't gain Airbending before
a previous feeding & simply hide it because he wasn't practiced enough. Totally feasible).
Secondly, there appears to be a pre-supposition of 'mastery'. I don't know that I would call ^that 'mastery'. It's definitely talented (see below for my hypothesis), but he basically just jumps around & manhandles some guards; big gusty wind things, nothing really finesse-y. At the end, he doesn't even bother trying to jump from pillar to pillar, he just makes a series of jumps down, with a simple air cushion. (**Now I want to be fair; I'm making a lot of presuppositions of my own as to the 'difficulty' associated with various airbending moves. But hopefully I'm being relatively agreeable in those assumptions).
It's clear, though, that what we see by the end of the season (some unknown number of days/weeks/months) is definitely more along the 'mastery' level, compared to what we see at the beginning of the season.
Now, to actually answer your question (or the stripped-down version I submit as a more precise one): "How did Zaheer learn enough airbending by himself to free himself & eventually go toe-to-toe with (what may perhaps be considered) the greatest living Airbending master)?"
To that, I would echo several of Omegacron's statements; stuff about "natural gift/talent", "we don't know his potential", "highly motivated", etc. However, I take a different tack.
It's established that Zaheer is in love with Airbender philosophy. His love affair with Guru Laghima, his encyclopedic knowledge of Airbender customs, history, lifestyle, poems, historical characters is impressive. Part of that, I believe, is a similarly-in-depth knowledge of the forms & styles of Airbending itself. We've all seen A:tLA's "Waterbending Scroll" episode; bending is really just martial arts & forms ("katas", perhaps?) that ostensibly anyone can read, study, practice, learn, and master. It's just that ineffable 'spark' of "benderhood" that is missing.
If you will, imagine a kid infatuated with Harry Potter & learning all the 'swish-flick' nonsense). Then one day, this Harry-Potter-obsessed kid is magically blessed with the actual ability to perform magic; he might very well perform at a higher level than some of his already-magical peers, due to his years of learning the forms (in fact, didn't this happen somewhere in the books? It's been a while).
So I envision a Zaheer that has spent his life (perhaps even before imprisonment) studying & memorizing everything there is to know about Air Nomads & Airbending. Then all of a sudden, he gets that 'spark' from the Convergence... And whaddaya know, he can do more than just spurt gusts with his fingers. This is further entrenched by the scene with him at the Air Temple 'being the leaf' so well amidst the spinning panels; he wasn't good at it because he had done it before (necessarily), but because he'd mastered the philosophy, mindset, and (potentially) forms associated with that trial.