In this paper, we investigate the flexible and efficient charging mechanism for electric vehicles (EVs). We first provide a developed V2V charging concept, termed as cooperative V2V charging, which enables active cooperation through charging and discharging operations between EVs as energy consumers and EVs as energy providers and is beneficial to both sides. Then, based on the defined utilities of EVs as energy consumers and EVs as energy providers, we propose a novel stable matching based cooperative V2V charging mechanism by taking each EV's individual rationality into consideration. Furthermore, we provide two efficient stable V2V matching algorithms, resulting in optimal V2V matching solutions in terms of the utilities of EVs as energy consumers and the utilities of EVs as energy providers, respectively. Simulation results verify the efficiency of our proposed stable matching based cooperative V2V charging mechanism in improving the utilities of both EVs as energy consumers and EVs as energy providers as well as reducing the energy consumption of the EVs compared with the traditional EV charging protocol.