While it is grammatically correct, it doesn't make much sense. I understand where you're coming from, since in French you "have" years, but on the other hand, you still "are" aged. You can definitely say je suis âgé de X ans. So using avoir is mostly just in that j'ai X ans phrase.
So, all that aside, the main problem is that you took "your age" and changed it in French to "your years". There's nothing wrong is using âge.
... pour les gens ayant votre âge.
And now things make more sense, but it sounds a little stilted, and without context, it's a little difficult to know if it would make sense with the rest of your sentence. What would be much more idiomatic is
... pour les personnes de votre âge.
It ends up being more like "for people your age", which is essentially the same, but it's a lighter structure that is much more natural. I also changed gens because you rarely use that word when addressing people. It happens, but using personnes is much more common.