The play begins with a meeting between two friends: Algernon Montcrieff and Ernest Worthing. Ernest is in love with Algy's cousin Gwendolen and has come up from his estate in the country to propose. Algernon however, refuses to consent to the match until Ernest explains a mystery; Algy has noted that his friend's cigarette case has an inscription from "Cecily" with love to "Uncle Jack". What's this about? Ernest is forced to admit that he's living a double life: at home in the country, he uses his true identity- Jack Worthing, a responsible landowner who is setting a good example for his sweet young ward Cecily, an heiress who is not yet out socially. When however, he wants to slip the bonds of responsibility by cutting loose in London, he tells Cecily he must travel to town to check on his reckless, wastrel younger brother "Ernest". There is, of course, actually no younger brother; Ernest is Jack's fun London identity. This confession by Ernest/Jack leads Algy to make one of his own: whenever he wishes to escape an unwelcome social event, he tells people that he must go to the country to visit an invalid friend named Bunbury who does not, in fact, exist.
Ernest's love Gwendolen arrives with her mother Lady Bracknell to visit Algernon. Now accepting of his friend's suit, Algy helpfully distracts the disapproving Lady Bracknell, giving Jack (Ernest) a chance to propose. Gwendolen enthusiastically accepts but he is unnerved when she waxes lyrical about his name, making it sound as if she could only ever marry someone named Ernest. This is a problem as of course, his actual name is Jack. He immediately resolves to be quietly rechristened Ernest to head off any potential trouble. Speaking of trouble, Lady Bracknell is seriously displeased with the news of their engagement and immediately starts questioning Jack/Ernest about his background. A snob, she is horrified to learn that he doesn't know much about it; he was adopted by the Worthings as a baby after being found in a handbag at Victoria Station. She immediately forbids the engagement and tells Jack to stay away from her daughter. Before being dragged away by her mother, Gwendolen manages to pledge her love to Ernest and he swiftly gives her his address in the country- in Woolton, Hertfordshire- so she can write to him. What he doesn't realize is that Algy has overheard and made note of the address; greatly interested in Jack's description of his pretty, wealthy ward, he decides to travel into the country to meet her.
Meanwhile in Woolton, Cecily has been left in the care of her governess Miss Prism. Algernon arrives and gains entrance to the house by introducing himself as Jack's younger brother Ernest. He makes himself very charming to Cecily, who has always been rather fascinated with tales of her guardian's absent black sheep brother. She falls in love with "Ernest" which leads Algy to make plans to have the local rector Dr. Chasuble rechristen him with the name Ernest. A spanner is thrown into the works by the arrival of Jack who, resolving to make himself worthy of marriage, has decided to give up his double life. He arrives dressed in mourning and announces that, tragically, he has received word that his younger brother Ernest has died of a sudden illness while visiting the fleshpots of Paris. Imagine his surprise when he finds his recently deceased "brother" is not only in residence on his estate, he's wooing his ward Cecily.
Back in London Gwendolen, devastated by her mother's denial of her engagement to Ernest (Jack), decides to run away and, possessing her fiance's country address, makes her way to Woolton. Arriving at the estate, the first person she meets is Cecily to whom she introduces herself as Ernest Worthing's fiancee. Cecily is aghast, indignantly declaring that, in fact, she is engaged to Ernest Worthing. Further shenanigans ensue. I won't go into all the details in case you haven't read- or seen- the play, but suffice to say that, in the end, the romantic entanglements get straightened out and the mystery of Jack's origins- and the discovery of his infant self in a handbag- is delightfully resolved.
I won't get into critiquing them now (it's getting late) but I've seen two film adaptations of The Importance of Being Earnest: the 1952 version and the 2002 version.