There are float switches that will do what you want. If you are using it to directly control the power, make sure the switch is beefy enough to handle the rated motor size. An alternative would be to use a low-voltage switch and have that control a properly sized power contactor or a relay that powers the pump.