Today, that's called Fanfic or Fan Fiction, or, to be pedantic, Fan-Written Fiction.
Fanfic is simply fiction written by fans of a story, whether a show, movie, book or comic.
And a good sign of a story's popularity these days is how much fanfic it generates.
Strictly speaking, writing and showing fanfic to others is a violation of the copyright of the originator.
The Star Trek franchise has even had fanfic contests and published anthologies of contest winning fanfic.