My girlfriend and I are almost 6 years different.
We started dating when I was 30, and she was 24.
Now, that might not seem like that big of a difference, but understand that I had spent the majority of my 20's with one woman who I married and later divorced.
(And oddly enough, my girlfriend got to meet my ex last weekend when we were in Connecticut for a lesbian wedding of a friend of my gf's. My ex (who lives in the Bronx right now) knew I was going out there via facebook, and wanted to get together for dinner with her boyfriend, my girlfriend, and I. It was pleasantly not awkward at all.)
But anyway, digression aside, most people at 24 who had never been married probably wouldn't be able to relate to what I had been through. And my gf was no different. But she was also very mature for her age, and it didn't cause any issues. I still mock her for not remembering a lot of the 80's, though.
So age can be an issue, but maturity on both sides is much more important than age. There is no magic numerical formula to determine whether people are compatible. Humans aren't purely rational beings, so one can't simply crank out numbers to determine if they are a match.