25 years ago.
"Simpson, have you been drinking?"
"Only for 25 years."
BTW: Homer did say that he had his first beer when he was 17, but in another episode (I forget which one exactly) there is a flashback to when Barney was studying before a test and Homer convinced Barney to have some beer, but that might not have been Homer's or Barney's first beer. Further more: Homer once said that he first drank beer when he was (probably about eight from the looks of the flashback) a kid and he and Barney then crashed their little red wagons.
"Let's never drink again" said Barney, in the flashback.
"And we never did." said Homer, and then he took a drink from his Duff can.