I just tested it in my Omega Ruby, here's what I got:
Entering a new area:
Used White Flute, took some steps in the same area, tried to use it again, it didn't work.
Entered new area, used White Flute, it worked.
I got the same results with the Black Flute.
I went into some tall grass, then used the Black Flute.
I went over and surfed in the water in the same area and tired to use the flute again, it didn't work.
Went into Meteor Falls and used the Black Flute.
Went into a different area of Meteor Falls, it also worked.
As for Pokemon Emerald, I found that it lasts only one step, but I found it all on the same site.
Here, here, and here.
Im assuming it has the same wear off time for the other games excluding ORAS, because the flutes have the same effect, but in ORAS it's different.
Hope this helps!
The the links listed above and my own experiment.