Yes, gears can be linked to levers - it's under "a", "link to a gear assembly". Switching the lever switches the gear assembly between engaged (transports/consumes power) and disengaged (doesn't).
The windmill must be supported by a solid building, so you cannot build it directly over a gear you wish to use for switching:
Gg%.
.#%#
.#x#
Windmill stands on gear G, the one next to it - "g" can be switched from the lever. If it's engaged, it will transmit power to the pump %% (pumping from north to south), if not, the pump turns off. The downside is that this already uses up the 20 power a windmill will provide in most biomes, so you have no power left over for axles or the like.
There are other options available: you could instead put a floodgate, door or raisable bridge in spot "x", the pump output. If that grid is blocked, the pump can no longer move liquid. Alternatively, you could place a lever-linked hatch cover over the tile the pump is pulling liquid from - if that hatch is closed, the pump cannot acquire liquid to move. In either case you can put the windmill directly on top of the pump; the pump itself can be active permanently.
And you can switch the pump by load - place the mill directly over the pump and attach enough switchable machinery to the pump that it will draw more power than the windmill can provide when the gears are engaged:
.%%g
#%%#
#..#
Two pumps side by side, windmill on top of one of the pumps. If the mill provides 20 power, that's just enough for two pumps, so when gear 'g' is engaged, load increases to 25 and the machine stops.
To halt a pump that's already installed without any switch-off machinery, you'll have to demolish the windmill, power train or pump if at all accessible. Or install some doors in the area that's about to get flooded and lock them. In some cases, you might have ways to stop liquid from reaching the pump intake. If you're unlucky, none of those options are available, which could mean you'll have to evacuate and re-build.