In a galvanic (voltaic) cell, the anode is considered negative and the cathode is considered positive. This seems reasonable as the anode is the source of electrons and cathode is where the electrons flow.

However, in an electrolytic cell, the anode is taken to be positive while the cathode is now negative. However, the reaction is still similar, whereby electrons from the anode flow to the positive terminal of the battery, and electrons from the battery flow to the cathode.

So why does the sign of the cathode and anode switch when considering an electrolytic cell? 

The anode is the electrode where the oxidation reaction

\begin{align}
 \ce{Red -> Ox + e-}
\end{align}

takes place while the cathode is the electrode where the reduction reaction

\begin{align}
 \ce{Ox + e- -> Red}
\end{align}

takes place. That's how cathode and anode are defined.

Galvanic cell

Now, in a galvanic cell the reaction proceeds without an external potential helping it along. Since at the anode you have the oxidation reaction which produces electrons you get a build-up of negative charge in the course of the reaction until electrochemical equilibrium is reached. Thus the anode is negative.

At the cathode, on the other hand, you have the reduction reaction which consumes electrons (leaving behind positive (metal) ions at the electrode) and thus leads to a build-up of positive charge in the course of the reaction until electrochemical equilibrium is reached. Thus the cathode is positive.

Electrolytic cell

In an electrolytic cell, you apply an external potential to enforce the reaction to go in the opposite direction. Now the reasoning is reversed. At the negative electrode where you have produced a high electron potential via an external voltage source electrons are "pushed out" of the electrode, thereby reducing the oxidized species $\ce{Ox}$, because the electron energy level inside the electrode (Fermi Level) is higher than the energy level of the LUMO of $\ce{Ox}$ and the electrons can lower their energy by occupying this orbital - you have very reactive electrons so to speak. So the negative electrode will be the one where the reduction reaction will take place and thus it's the cathode.

At the positive electrode where you have produced a low electron potential via an external voltage source electrons are "sucked into" the electrode leaving behind the the reduced species $\ce{Red}$ because the electron energy level inside the electrode (Fermi Level) is lower than the energy level of the HOMO of $\ce{Red}$. So the positive electrode will be the one where the oxidation reaction will take place and thus it's the anode.

A tale of electrons and waterfalls

Since there is some confusion concerning the principles on which an electrolysis works, I'll try a metaphor to explain it. Electrons flow from a region of high potential to a region of low potential much like water falls down a waterfall or flows down an inclined plane. The reason is the same: water and electrons can lower their energy this way. Now the external voltage source acts like two big rivers connected to waterfalls: one at a high altitude that leads towards a waterfall - that would be the minus pole - and one at a low altitude that leads away from a waterfall - that would be the plus pole. The electrodes would be like the points of the river shortly before or after the waterfalls in this picture: the cathode is like the edge of a waterfall where the water drops down and the anode is like the point where the water drops into.

Ok, what happens at the electrolysis reaction? At the cathode, you have the high altitude situation. So the electrons flow to the "edge of their waterfall". They want to "fall down" because behind them the river is pushing towards the edge exerting some kind of "pressure". But where can they fall down to? The other electrode is separated from them by the solution and usually a diaphragm. But there are $\ce{Ox}$ molecules that have empty states that lie energetically below that of the electrode. Those empty states are like small ponds lying at a lower altitude where a little bit of the water from the river can fall into. So every time such an $\ce{Ox}$ molecule comes near the electrode an electron takes the opportunity to jump to it and reduce it to $\ce{Red}$. But that does not mean that the electrode is suddenly missing an electron because the river is replacing the "pushed out" electron immediately. And the voltage source (the source of the river) can't run dry of electrons because it gets its electrons from the power socket.

Now the anode: At the anode, you have the low altitude situation. So here the river lies lower than everything else. Now you can imagine the HOMO-states of the $\ce{Red}$ molecules as small barrier lakes lying at a higher altitude than our river. When a $\ce{Red}$ molecule comes close to the electrode it is like someone opening the floodgates of the barrier lake's dam. The electrons flow from the HOMO into the electrode thus creating an $\ce{Ox}$ molecule. But the electrons don't stay in the electrode, so to speak, they are carried away by the river. And since the river is such a vast entity (lots of water) and usually flows into an ocean, the little "water" that is added to it doesn't change the river much. It stays the same, unaltered so that everytime a floodgate gets opened the water from the barrier lake will drop the same distance.
