This happens occasionally. The thermostat reaches the desired temperature, the indoor unit shuts off but the outdoor unit keeps on running. In the heating mode it could eventually go off on a high pressure safety device. But in the summer it will run forever unless you turn the breaker off. And the indoor coil will probably be frozen solid.
This is usually caused by only a few things. The most common of which is a stuck compressor contactor. This is located in the outdoor unit. The contacts tend to get pitted-up. Eventually they can weld shut. This can cause serious damage to the system. It is good practice to replace the contactor every few years or when pitted - just like spark plugs in a car.
Other causes would be a shorted thermostat cable. This can be caused by a weed-whacker hitting the wire outside, or a wire-staple digging into the wire too tightly, rodents chewing on it, or just bad wire.
The thermostat itself could be bad, sending a signal to the outdoor unit when it isn't supposed to.
Below is a list of possible causes and things to check. Items in blue usually require a service call. Items in red however can be addressed, even fixed by the homeowner.