This feels like shrodingers question
Can it work? Yes
Can it be a problem? Yes
There is no yes or no here. If you’re committed to one another it can be fine. If things aren’t the way you want them to be, this will be something you point to as a problem
It matters, in a relationship everything matters. The thing you need to decide is whether or not the hassle is worth it. A significant age gap will be off from the socially accepted norm and people will sometimes judge you. You will face extra scrutiny from friends and family who should be honest about their reservations and then come to accept the age gap if the relationship is healthy.
People not liking your partner may seem tied to the age gap and it is difficult to separate that. If your partner is too immature, which can be a real problem, then it is not the number on his driver's license but his development that is the issue. In addition it is often easier for older adults to pray on younger ones using simply experience. He may want to use you physically and then may get bored with you leaving you an emotional wreck. He may want to use you financially for a while. This doesn't mean he would do that or has, but it's possible and you may be unable to see that as you're blinded by love. Of course he may be preying upon you but you may be better than he is and then end up married and happy.
Whatever the the case, and regardless of how good or not he is for you. Emotions are not hard math, you decide if he's worth the added judgement you'll face. From that you make your own decisions, the one factor your friends and family won't ever have is how he makes you feel. Good luck.
I think Chris Hansen has demonstrably proven that it does indeed matter.
My parents had an 18 year difference between them. I found that when my partner was five or more years younger than I, we did not always have the same point of reference. That became a problem as we went further along in our relationship. That does not have to be when there is open communication beween the two people.
Everyone is an individual, but many men mature much more slowly than women, and as a result many women prefer to marry older men. And an older man may also be established in his career, and feel confident he can support a family. I married at 38, and am still married. If I had married at 28 it might have lasted 6 months or less.