the flames are colored because:
when a substance is burning the electrons in the last shell get energy and go to a higher energy states (you will learn about energy states in your later classes), and when these electrons come back to their normal states, they release energy in the form of light, imparting color to the flame, which depends on the energy gap between which the transition takes place, and since copper has a particular energy gap which gives green hence, the flame is imparted a green color.