You cannot add links to the gallery. You could create a field groups that is added to “attachments” and add the links when editing the image. Then when looping through the gallery you can use the attachment ID to get this other custom field and do something with it.