Amber is not a mineral. Amber is fossilized resin from ancient pine trees. Resin isn't sap but a complex chemical that a plant produces in its epithelial cells. The volatile components of the resin evaporate, but the nonvolatile components can fossilize.
As the resin fossilizes, it becomes part of the soil and turns into amber over millions of years. Scientists believe that most of the amber that is found is from the Cretaceous or Tertiary periods, making it between 30 and 90 million years old. Amber is one of the few organic products that are considered gemstones; others include pearls and coral.