You can eat any chicken of any sex and age, you just have to adjust the cooking methods to suit the sex and age. The older the chicken the more mature the meat, both in texture and flavor. Cockerels mature faster than pullets in both of these. The older the chicken the slower you have to cook it and the more you need to up the moisture.
There are a lot of age-appropriate ways to cook chickens. You can find several threads in the meat bird section on that. To show that you can eat an old mature rooster, Coq au Vin is the traditional French way to cook an extremely old mature rooster. That’s considered fine dining by many people in fancy restaurants.
When is a personal choice. Some people butcher cockerels at 12 weeks so they can fry or grill the birds before they mature so much they start to get tough if you use these methods. Of course, different ones of us have different definitions of “tough” too. A lot of that depends on what you are used to. There is very little meat in a bird this age but if you live where you can’t have roosters, you might need to butcher pretty early.
I try really hard to never butcher before 16 weeks and much prefer to wait until later. Some cockerels grow faster than others. A few are getting pretty good at 18 weeks but some need another month or even more to fill out to a decent carcass.
Dual purpose chickens are those that have been developed to provide both meat and eggs. The Cornish X, Cornish Cross, Broilers, Freedom Rangers and such have been developed purely for meat. They are not dual purpose. The commercial hybrid egg layers were developed purely for egg laying. They don’t have much meat on their body. You can eat them but you won’t get much meat. Bantams are not considered dual purpose although you can eat them. There’s just not much meat there. Many decorative breeds are not considered dual purpose, as much because they don’t lay very well as having anything to do with eating them.
Dual purpose can mean different things to different people. Game chickens are often fairly small so to many people they would not be considered dual purpose, but many small farmers for thousands of years have kept free ranging flocks of games to provide their families with meat and eggs while foraging for most of their own food.