Do both riders on a tandem need to know how to ride a bike? I want to take a visiting friend out on a bike ride. 

Since this friend never learned how to ride a bike, I was thinking that a tandem might be a viable solution in the short term, instead of spending time on teaching them how to ride a bike.

I've never ridden a tandem myself, so I wonder if both buddies must be capable of riding a bike on their own, or only one is sufficient.
Sheldon Brown (of course) has a good page on riding tandem.  He doesn't get into details, but since the stoker's main job is to keep upright it doesn't demand a lot of bike handling skill.  Riding as stoker for the first time is similar to being passenger on a motorbike for the first time; the main thing to learn is not to lean or shift your weight.  All the bike-handling skill comes from the captain, and as the captain it's a good idea to become familiar with the handling of the tandem before you try riding with a stoker.  (Brown's page covers all this.)

In my experience the trickiest part of riding stoker is getting mounted; holding steady balance with both feet on the pedals as the captain mounts.  You might try having a pole or something similar for the stoker to put a hand on to help their balance.

So the answer is no, the stoker doesn't really need to learn how to ride, in the sense of knowing bike-handling skills.  That said, the stoker does need to learn how to sit on the saddle without throwing the balance of the bike, and also to learn to turn the pedals at the same time - and in the same cadence - as the captain.  Again, from experience, synchronized pedalling is one of the hardest parts of riding tandem, especially if you're an experienced cyclist who tends to spin continuously.