We can do dimensional analysis in this particular problem. We do as follows:
PEs = 1/2 kx^2
kg . m^2 /s2 [=] k (m)²
The units in the left side should be the same units as the resulting units in the right side.
kg . m^2 /s2 [=] (kg/s²) (m)²
Therefore, the units of k should be kg/s².