When we connect ends of a battery by copper wire with potato by inserting into it, the electrons from negative potential of battery through copper wire reach the potato where they undergo electrolysis in presence of potato juice(starch). This process release electrons in potato and increase the negative particles. When these negative particles reach the other end of copper, it reacts with a part of Cu wire inside potato and makes a complex which is green in colour. Hence it becomes green on passing electricity.