A spring constant is a constant that is proportional to the size of a force that varies with displacement. This can be of a spring, but may also be of any force that varies as (following Hooke's law), with k being the spring constant.
It has dimensions of [mass][time]-2.
Because force is the negative gradient of potential, the potential energy of a particle moving under a Hooke's law force with a spring constant k is (plus an arbitrary constant, which can be set to zero). Any potential of this form gives rise to simple harmonic oscillations.