I'm sure there are plenty of never-released gay/lesbian films from early cinema, but what was the first film released in theaters for the general public? For this question, let's consider openly gay someone who claims they are gay with words, or participates in PDA on screen (not looking for films with implication of sexuality, but factual evidence).
Plot summary from wikipedia:
Veidt portrays a successful violinist, Paul Körner, who falls in love with one of his male students. A sleazy extortionist threatens to expose Körner as a homosexual. Flashbacks show us how Körner became aware of his orientation and tried first to change it, then to understand it.
After Körner's coming out, he and Sivers begin seeing each other more openly. While walking together, hand in hand, through the park, they pass a man who recognizes Körner. Later that day, when Körner is alone, this man, Franz Bollek (Reinhold Schünzel) confronts him and demands hush money or else he will expose Sivers.
See also IMDB
For the second time today, I find myself submitting Mädchen in Uniform from 1931 as an answer... Though there were various gay stereotypes in film before it, I struggle to find an earlier movie that had a lesbian character (in this movie a 14 year old student in love with her female teacher) that actually confesses her love. It also features a lesbian kiss in the guise of a 'goodnight kiss'. German cinema contains some earlier examples like Sex in Chains from 1928 and Different from the Others from 1919 mentioned in knut's answer, but the former only contained ambiguous homoerotic themes and the latter was severely censored and restricted.
My guess would be Vingarne (The Wings) (1916), It was based on a 1902 novel by Herman Bang and the story it was adapted from was explicitly queer (at least from what I can find out about it online). While it's more subtle in the film, the characters would have been understood to be gay in the context of the story. Other than that if we look at the Nance Stereotype, that type of character can be found all the way back to Algie The Miner (1912) (the trope itself is much older, that's simply the earliest depiction on the silver screen I've found), however with that YMMV.
I would agree that most people cite Different from the Others (1919) as the first film showing a gay relationship.