The mechanical potential energy of a spring that is elongated or compressed.