All wells and water reservoirs, whether on public or private land, should be registered with the authorities of your Autonomous Region.
Within the Department of Medio Ambiente there´s a division called ´Agua´ and they control the register. There are ´Oficinias del Registro de Aguas´ in each ´Organismo de Cuenca´ which means as much as the regional or inter-regional headquarters of the Division de Agua. Usually in the capital of your province.
Google for ´Como consultar Registro Publico de Aguas´ and the name of your Autonomous Region and you should find the relevant info.
For Andalucia it´s
and
If you are considering the purchase of a property with a well or water deposit, ask for the registration papers if it hasn´t been added to the title deeds (escritura) yet.