I'm not quite sure how fanfiction specifically plays into it. Neil Gaiman is cheerily writing fanfiction in his fifties (and it is awesome
), and there is at least one writer who started a story when they were in their mid teens, only finishing it in their forties
On the other hand, there is some really hackneyed published "original" fiction out there
written by teenagers, which is pretty embarrassing to read.
You are never too old to write fanfiction, but you eventually do get too experienced
to keep writing shitty fiction (assuming this "writing" thing is something that you do regularly). A lot of the time this means that you come up with your own ideas and settings and leave behind the realms of other people's work. For some people, it just means that you try harder to make something original out of the already-established. It has very little to do with age.
tl;dr version: Write what you want to write, and when you don't want to write it anymore, then don't.
Caaan anybody find me... Somebody to ♠