Why does the anode carry the negative charge in galvanic cell but positive charge in electrolytic cell?
Electrons flow into the anode in a galvanic cell and out of the anode in an electrolytic cell
First, understand that the anode is defined as the electrode at which oxidation occurs and cathode as the electrode at which reduction occurs.
The question is now why does the oxidation occur at the negative terminal in a galvanic cell and the positive terminal in an electrolytic cell?
In a galvanic cell the solutions are the source of potential difference and can be thought of as "pushing" the electrons through the circuit. this is done through the oxidation of anions (negative ions) at the negative anode, oxidation is loss and therefore we have the anions supplying the electrons to travel through the circuit, the negative electrode being the source of electrons in a circuit.
In an electrolytic cell the roles are reversed and there is an external source of electricity. the negative electrode (source of electrons) is now releasing electrons into the cell and resulting in reduction. and remember that the electrode at which reduction occurs is the cathode. So if we have one electrode which is the negative cathode then the other must be a positive anode.