We demonstrate theoretically that electric field can drive a quantum phase transition between band insulator to topological insulator in CdTe/HgCdTe/CdTe quantum wells. The numerical results suggest that the electric field could be used as a switch to turn on or off the topological insulator phase, and temperature can affect significantly the phase diagram for different gate voltage and compositions. Our theoretical results provide us an efficient way to manipulate the quantum phase of HgTe quantum wells.