The easy part: According to MLA Handbook, you cite a movie as: title underlined (we often use italics instead of underlining), director, distributor, and year released. You may mention writers, actors, and/or producer. Example:
It's a Wonderful Life. Dir. Frank Capra. Perf. James Stewart, Donna Reed. RKO, 1946.
For a TV series, they say title of the episode in quotes, title of the program underlined (or italics), title of the series (by which they seem to mean a group of related episodes within a program) neither underlined nor in quotes, name of the network, call letters and city of the local station if applicable, and broadcast date. Example:
"Chrysalis", Babylon 5, PTEN. Oct 26, 1994.
The harder part is how to attribute words of a fictional character. If you just name the character, it gives the impression that that's a real person. But if you just give the author, that loses context for people who are familiar with the character, and it could be very misleading, implying that the author really believes those words, when it could be that he put them in the mouth of a fool or a villain. Also, when you're quoting characters from a TV show or movie, it's not always easy to find out exactly who wrote the line you're quoting: many such programs have multiple screen writers and the actors may ad lib.
It's common when quoting TV and movie characters to put the character's name followed by the actor in parentheses. Like:
"Things are not always what they seem." G'Kar (Andreas Katsulas)
That's probably what I'd do for a TV show. For a novel, I'd want to mention the character and the author, but I don't know a consistent, recognized format for this and couldn't find one with a little web searching. I'd think something like:
Sherlock Holmes, in Doyle, Arthur Conan. "A Study in Scarlet", The Adventures of Sherlock Holmes etc.