Q:

How long does advantage last in football?

I've seen the referee award advantage (and the announcer will indicate as much).  I get the sense that advantage only lasts for the next couple of touches.  I've seen possession get turned over and a free kick not awarded afterward.
So, how long does advantage last after awarded?

A:

This is covered in Law 5 "The Referee", Section 3 "Powers and Duties":

[The referee] allows play to continue when an offence occurs and the non-offending team will benefit from the advantage, and penalises the offence if the anticipated advantage does not ensue at that time or within a few seconds

i.e. either the offence has to be penalised within a few seconds, or play is allowed to continue; the referee cannot "go back" more than those few seconds.

