A voltaic cell is an electrochemical cell that uses a chemical reaction to produce electrical energy. An electrochemical cell consists of two electrodes (anode and cathode), two electlolyte solutions, and a salt bridge:

The anode is an electrode where oxidation occurs and the cathode is an electrode where reduction occurs. The oxidation and reduction reactions are separated into compartments, which are called half-cells (each half-cell consists of electrode and the appropriate electrolyte solution). The salt bridge connecting half-cells is a chamber of electrolytes, which are needed to maintain the neutrality of the solutions in both half-cells. The external circuit is used to conduct the flow of electrons between electrodes, which usually go through a load (e.g., a light bulb or voltmeter) to close the circuit (see the diagram).
Now, let's see what chemical reactions are happening in your voltaic cell. Your two half cells are $\ce{Mg/Mg^2+}$ (suppose your $\ce{Mg^2+}$ solution is an aqueous $\ce{Mg(NO3)2}$ solution) and $\ce{Ag/Ag+}$ (suppose your $\ce{Ag+}$ solution is an aqueous $\ce{AgNO3}$ solution). Suppose your salt bridge is $\ce{NaNO3}$. To find where oxidation and reduction happening, you may need to look table at the end of your textbook, which is called electrochemical series, giving reduction potentials of many elements such as following:
$$\ce{Ag+ + e- <=> Ag} \qquad \mathrm{E}^\circ = \pu{0.7996 V} \tag{1}$$
$$\ce{Mg^2+ + 2e- <=> Mg} \qquad \mathrm{E}^\circ = \pu{-2.372 V} \tag{2}$$
To have a positive electron flow (or spontaneous redox reaction), $\mathrm{E}_\mathrm{cell}^\circ$ should be positive. So, you can rearrange equation (2) such that complete redox reaction gives positive $\mathrm{E}_\mathrm{cell}^\circ$:
$$\ce{Mg <=> Mg^2+ + 2e-} \qquad \mathrm{E}^\circ = \pu{+2.372 V} \tag{3}$$
Now see, in equation (1), $\ce{Ag+}$ gains $\ce{e-}$s, so that it reduces. Therefore, $\ce{Ag/Ag+}$ half-cell is the cathode where reduction happens.
In equation (3), $\ce{Mg^2+}$ gives away $\ce{e-}$s, so that it oxidizes. Therefore, $\ce{Mg/Mg^2+}$ half-cell is the anode where oxidation happens.
Solving (1) and (3) in order to cancel $\ce{e-}$s, you'll get total redox reaction:
$$\ce{Mg + 2Ag+ -> Mg^2+ + 2Ag} \qquad \mathrm{E}_\mathrm{cell}^\circ = \pu{+3.172 V} \tag{3}$$
Overall, at anode, the $\ce{Mg}$ electrode slowly dissolve, and the magnesium cations enter the aqueous solution, giving it a net positive charge. The electrons left at the anode will travel to the cathode through the external circuit (connected to the load).
At the same time, $\ce{Ag+}$ travel to the cathode, and gains $\ce{e-}$s comes through the wire to become $\ce{Ag}$. $\ce{Ag}$ deposits on cathode, and thus, the aqueous solution loses the silver cations, giving it a net negative charge. The salt bridge, then does his duty by neutralizing these two aqueous solutions (see the diagram).
Note: The galvanic cell is courtesy of ELI JONES. The original one was modified in order to suit to the current question in hand.