How to get the Magic Powder
You can get the Magic Power as early on in the game as you possibly want to - really the only requirement to acquiring it is you bring Zelda to the Sanctuary! The first step to getting the Magic Powder is heading to the northwest part of the Light World where you'll find the Lost Woods.
After entering the Lost Woods you'll want to travel northwest keeping an eye out for a Mushroom on the ground that we're after. On your way to this Mushroom you'll pass by a stump with an opening and behind that stump there'll be 9 bushes lined up 3 x 3.
If you slice through these bushes you'll find a hole that you can fall down into that will lead to a Piece of Heart! After you acquire the Piece of Heart (or skip it altogether) you'll want to keep going northwest until you eventually come across the Mushroom you see in the screenshot below.
Once you find the Mushroom pick it up and that's all we need here. In order to get the Magic Powder from this Mushroom you'll want to take it to the Magic Shop which is far east of Kakariko Village - east of the Sanctuary and east of the Hyrule Cemetery.
On the other side of Hyrule Castle you'll find a Magic Shop run by an old hag. Give the Mushroom to her and she'll tell you to come back later to pick up the Magic Powder. You can easily go one or two screens over and come back to make enough time pass. You will need to head inside the Magic Shop to pick up the Magic Powder - the hag will just keep repeating come back later
That's all there is to it! The Magic Powder is an important item for your quest - it's used for the Magic Meter Upgrade later in the game! Additionally if you have the Flute you can just Fast Travel to the Magic Shop instead of actually running there.