Gilby, I wonder if you've most likely found the "tomato worm" (aka corn earworm) which is far different from a tomato hornworm. Hornworms tend to defoliate a plant by eating the whole leaf and petioles, not putting holes in them. Tomato worms will also eat leaves as well as bore into the fruit, sometimes "hole by hole".
"What should I do if I want to keep them and my plants?"
I'd do as Josephine suggested, keep them alive and feed them in a container (jar, old aquarium, etc) to keep the worms alive and watch their life stages develop. It's a pretty interesting sight to see!
Shoe (off to eat a tomato sandwish, minus the worms!) :>)