This was revealed in the movie when Dorothy and her friends are traveling to the Emerald City and encounter the Wizard in his balloon. He uses the balloon to lower himself down to them and eventually takes them back to Kansas.
Although the movie features a balloon, the book doesn't specify how the Wizard traveled. It just mentions him living in a "great big castle" that was "high up in the air."