The basic difference that you have to remember is that "wondering" is about thought processes, and "wandering" is about distance. But there are some caveats to that, so read on!
Let's consult the dictionary for the specifics. There are a few definitions for "wonder":
Wonder (verb): 1. to think or speculate curiously. 2. to be filled with admiration, amazement, or awe; marvel (often followed by 'at'). 3. to doubt.
"What would anyone want with a blast-ended skrewt?" Harry wondered.
Ron wondered at Hermione's ability to carry all those books. She was wonderfully strong.
After yet another photo, Harry wonders if Colin Creevy will ever leave him alone.
So, there are a few nuances to "wondering", but all of them are thoughtful sorts of things. By contrast, "wander" is generally about physically going somewhere:
Wander (verb): 1. to ramble without a definite purpose or objective; roam, rove, or stray. 2. to go aimlessly, indirectly, or casually; meander.
Harry and Hermione spent months wandering the English countryside, searching for a solution to the Horcrux problem.
"Don't wander off," Harry warned the others, "you never know what could be out there in the Forbidden Forest."
Now we've established pretty well that "wondering" is about the mind and "wandering" is about physical location. But of course, that solution is a little too simple--thoughts can wander, can't they? There's another definition to "wander" that we have to consider:
Wander: (of the mind, thoughts, desires, etc.) to take one direction or another without conscious intent or control.
Professor Binns was so boring, even Hermione's attention wandered.
Harry let his mind wander. He'd been working on the problem for so long he just couldn't focus anymore.
So "wander" can apply to thoughts, too, but if you think about it, it's still a pretty physical idea--my thoughts were here, but now they've wandered somewhere else. If you hang onto that idea of distance, you'll be able to tell the difference between the two words.
It also might be helpful to consider the subjects and verbs specifically:
Harry wonders: This describes Harry's thought process, his pondering.
Harry wanders: This describes the movement of Harry's physical body.
Harry's mind wanders: This describes the mental kind of wandering.
So, if Harry himself is going somewhere, it's "Harry wanders". If Harry himself is considering a question, it's "Harry wonders". And if we're describing the state of Harry's thoughts or attention, then it's "Harry's attention wanders".
Here are a couple of mneumonics that might help:
If you want to refer to something far away, remember to spell "wander" with an A.
If your character is pondering a question, then spell "wonder" like "ponder".
(definitions from dictionary.com.)