A knife with a blade that folds closed is called a jackknife. Most jackknives are compact enough to fit in a pocket, but we don't suggest your taking one to school.
Another name for a jackknife is a pocketknife. Some jackknives have several different blades, all of which fold tidily (and safely) into the body of the knife, while others unfold to reveal a single blade. The bend of a jackknife inspired the name of the dive also called the jackknife, in which the diver's body folds into a V shape and then straightens out before the diver hits the water.