The only free and comprehensive online etymological dictionary of the Spanish language
querido (Adjective) "beloved"

19th cent. The past participle of querer.

For the origin of the name, perhaps originally a nickname - as was the case of names like Amado.