LONDON—GlaxoSmithKline PLC and Google parentAlphabet Inc. have teamed up to develop what they call bioelectronic medicines, or treatments that use miniature implanted electronic devices to modify how electrical impulses are transmitted around the nervous system.

The U.K. pharmaceutical company said it had signed an agreement with Verily Life Sciences LLC, formerly Google Life Sciences, to create Galvani Bioelectronics. It said the pair would spend as much as £540 million ($714 million) over seven years on the venture, provided...