Endophytic fungi are emerging as attractive producers of natural products with diverse bioactivities and novel structures. However, difficulties in the genetic manipulation of endophytic fungi limit the search of novel secondary metabolites. In this study, we improved the polyethylene glycol (PEG)-mediated protoplast transformation method by introducing the CRISPR/Cas9 system into endophytic fungus Pestalotiopsis fici. Using this approach, we performed genome editing such as site-specific gene insertion, dual-locus mutations, and long DNA fragment deletions in P. fici efficiently. The average efficiency for site-specific gene insertion and two-site gene editing was up to 48.0% and 44.4%, respectively. In addition, the genetic manipulation time with long DNA fragment (5–10 kb) deletion was greatly shortened to one week in comparison with traditional methods such as Agrobacterium tumefaciens-mediated transformation (ATMT). Taken together, the development of the CRISPR/Cas9 system in the endophytic fungus will accelerate the discovery of novel natural products and further biological study.