In the Golden Age (from the early forties to the late fifties/early sixties), the character couldn't fly at all.
In the Silver Age (late fifties/early sixties to the early eighties), Diana gained the ability to glide on air currents starting in Wonder Woman (vol 1) issue #98, May 1958.
Post-Crisis on Infinite Earths (in 1985), Wonder Woman's origin has been rebooted, and she could fly freely from the start. Hippolyta made a baby out of clay and the goddesses (plus Hermes, for some reason) granted Diana beauty, power, strength, speed and flight.
In 2011, DC Comics' entire line of publications was relaunched, and Wonder Woman's origins have been rebooted again. This time she was a demigoddess, daughter of Hippolyta and Zeus, and was also gifted the ability to fly by Hermes. In this case Hermes scratched her with one of his feathers as Wonder Woman was trying to save Zola who was falling to her death.