I believe you're talking about tomato fruitworms. They're incredibly common, unfortunately. It's really a caterpillar that will turn into a moth. They lay their eggs on the leaves, and once they hatch, the larva burrows on in. You can use neem oil as an organic method to try and control the pests.