As you can see here, the Ben alias is a way for Obi-Wan to stay incognito on Tatooine. He moved there after the events of Revenge of the Sith, 19 years before A New Hope. We can safely deduce that Obi-Wan assumed the alternate identity of Ben as soon as he relocated, and those 19 years can be thought of as "a long time".
Obi-Wan didn't tell Luke he "hasn't used 'Obi-Wan' since a long time before Luke was born." Here is the actual quotation, directly from the script of A New Hope:
BEN: Obi-Wan Kenobi...Obi-Wan? Now thats a name I haven't heard in a
long time...a long time.
LUKE: I think my uncle knew him. He said he was dead.
BEN: Oh, he's not dead, not...not yet.
LUKE: You know him!
BEN: Well of course, of course I know him. He's me! I haven't gone by
the name Obi-Wan since oh, before you were born.
So he said he wasn't called Obi-Wan for a long time, and this time was roughly before Luke was born. In fact, I checked the Revenge of the Sith script and he had been called Obi-Wan by Padme just after, but Yoda also called him "Master Kenobi". In any case, "before you were born" is a decent approximation for events that occurred 19 years prior.