Copper is purified by electrolysis. Electricity is passed through solutions containing copper compounds, such as copper sulfate. The anode (positive electrode) is made from impure copper and the cathode (negative electrode) is made from pure copper.
Pure copper forms on the cathode. The slideshow shows how this works:
Purifying copper by electrolysis
During electrolysis, the anode loses mass as copper dissolves, and the cathode gains mass as copper is deposited.
The slideshow shows what happens during the purification of copper by electrolysis:
The purification of copper by electrolysis