You should try and feed your dog at certain times instead of just when his bowl is empty. I guess if you are exercising him a lot and he isn't putting on too much weight than it should be ok.
A rough guide to feeding quantities can be found on most pet food packets.
Variations on this will depend on your dogs calorie output or activity level. It’s age and the presence of any other diseases may also alter the recommended calorie intake.
One cookie is the calorie equivalent of an entire hamburger for your dog so try not to feed human food snacks as these can add up with out anyone noticing. Dog treats are fine in moderation.
If you are unsure about your dogs nutritional requirements it’s best to consult with your veterinarian as this will ensure that they are getting exactly the right food for their needs.