Anodes and cathodes are the endpoints or terminals of a device that produces electrical current. Electrical current runs from the positively charged terminal to the negatively charged terminal. The cathode is the terminal that attracts cations, or positive ions. To attract the cations, the terminal must be negatively charged. Electrical current is the amount of charge that passes a fixed point per unit time. The direction of the current flow is the direction a positive charge would go. Electrons are negative, and will move in the opposite direction of current.
In a galvanic cell, the current is produced by connecting an oxidation reaction to a reduction reaction in an electrolyte solution. Oxidation and reduction reactions or redox reactions, are chemical reactions involving a transfer of electrons from one atom in the reaction to another. When two different oxidation or reduction reactions are connected electrically, a current is formed. The direction depends on the type of reaction taking place at the terminal.
Reduction reactions involve the gain of electrons. Electrons are needed to fuel the reaction and pulls these electrons from the electrolyte. Since electrons are attracted to the reduction site and current flows opposite the flow of electrons, current flows away from the reduction site. Since current flows from the cathode to the anode, the reduction site is the cathode.
Oxidation reactions involve the loss of electrons. As the reaction progresses, the oxidation terminal loses electrons to the electrolyte. Negative charge is moving away from the oxidation site. A positive current would move towards the oxidation site, against the flow of electrons. Since current flows to the anode, the oxidation site is the anode of the cell.
Anode: positively charged terminal - oxidation reaction.
Cathode: negatively charged terminal - reduction reaction
There are a couple mnemonics that can help remember the details.
To remember the charge: Ca+ions are attracted to the Ca+hode (the t is a plus sign)
To remember which reaction occurs at which terminal: An Ox and Red Cat - Anode Oxidation, Reduction Cathode