There are a few possibilities; The Fan switch is bad.
The fan relay has failed.
The temperature sensor is often in the circuit so it might have failed or is failing. Even if you have a temperature gauge, the gauge sender and sensor for the ECU and cooling fan are seperate. They are usually next to each other an either on the head next to the thermostat or thermostat housing.
That would be the complete circuit. The only other part that can fail is some cars have a fan control box which turns the fan off after a certain time after the car has been turned off. If your fan stays on after you turn the car off, you probably have a control box like this. However, it is the least likely component to fail.