How to edit/insert new gene after cutting with CRISPR/cas9
Cas9 is used to create a double-stranded break (DSB) in genomic DNA. The cell can then use homology directed repair (HDR) to repair the break. The cell can also use non-homologous end joining (NHEJ) to repair DSBs, but this isn't useful for inserting specific sequences. In HDR, a sequence homologous to either side of the break site is used as a template so that the break can repaired error free. Naturally, the homologous template could be a homologous chromosome or replicated copy of the broken chromosome.

However, consider a situation where you introduce DNA into the cell with regions of homology to the break site and whatever other sequence(s) you wish to insert/delete/change. In this case, the break can be repaired using this exogenous DNA as a template and your changes will then be incorporated into the genome.

There are other methods of introducing site-specific DSBs to the genome, such as TALENs. The big advantage of CRISPR/Cas9 is that site recognition is performed by RNA rather than protein (it is much easier to synthesize small RNAs than to engineer large proteins).