Take molten sodium chloride. Its Na+ and Cl− ions are free to move, but they will never turn back into sodium metal and chlorine gas by themselves; sodium burning in chlorine is fiercely spontaneous, and this is that reaction run backward. Dip two carbon rods in the melt and connect them to a power supply. The supply forces electrons into one rod, which becomes negative and attracts Na+; each ion takes an electron and becomes liquid sodium. That rod is the cathode. The supply pulls electrons out of the other rod, which becomes positive; Cl− ions give up electrons there and bubble off as chlorine gas. That rod is the anode.
The names follow the reaction, not the charge. Reduction is still at the cathode and oxidation still at the anode, exactly as in a battery; only the signs are reversed, because in a battery the anode is the negative end. The supply must also beat the size of the uphill step. For sodium chloride the cell potential is −4.07 V, so it takes more than 4.07 V, and the reaction stops the instant the power is cut.
Water changes the outcome. In salt water the cathode can reduce either Na+, at −2.71 V, or water itself, at −0.83 V, and the easier reduction wins, so hydrogen bubbles form and no sodium appears. A zinc-copper cell lighting a bulb also has electrodes, solutions and a current, but there the current comes out of the reaction. Ask where the energy comes from: if removing the power supply would stop the reaction, the cell is electrolytic.
Think of it like this. If a galvanic cell is a ball rolling downhill, an electrolytic cell is someone pushing the ball back up. The push must be bigger than the hill is tall, which is the size of the negative cell potential, and the moment the pushing stops the ball goes nowhere. Real cells need a little extra push beyond the height, because of resistance and slow electrode reactions.
Core idea. Spend electrical energy to run a redox reaction uphill: the power supply pushes electrons into the cathode for reduction and pulls them from the anode for oxidation, and the amount of product is set by how much charge flows.