The war ended when the Chinese declared a ceasefire on November 21 1962, and simultaneously announced its withdrawal from the areas it had ccupied.
The Chinese did this, as the US decided to send its aircraft carrier, and provide air support to Indian army in the war.