A pet project started by a filmmaker to satisfy their massive ego. One can usually tell because they'll take two or more of the roles of producing, directing, writing, and/or acting. If they're playing the protagonist, expect a "Jesus by a different name" vibe (compare Mary Sue). Most vanity films revolve around a blunt political message. While total nobodies are capable of and expected to create vanity films, the term is generally reserved for established celebrities throwing caution to the winds.
Some infamous vanity films include Battlefield Earth by John Travolta, The Postman by Kevin Costner, The Passion of the Christ by Mel Gibson, and The Room by Tommy Wiseau.