You can read a detailed plot summary here at enotes at the following link.
A very brief overview of the play:
Two men, Algernon and Jack, pretend to be other people in order to win the affections of two ladies, Gwendolyn and Cecily. Both of these women are infatuated with the idea of being married to man who has the name Ernest. They aren't all that concerned with the actual person, they like the virtue implied by the name. Both Algernon and Jack take on the name Earnest and things get complicated when both women think they are engaged to the same man. Also at issue in the play is what Wilde is saying about the shallowness and frivolousness of high society. Gwendolyn's mother, Lady Bracknell, is the primary source of this satire, as she makes it very clear what kind of man would be suitable for her daughter.
Once all the confusion is cleared up, Gwendolyn is allowed to marry her Ernest, really named Jack, and Cecily agrees to marry her Ernest, really named Algernon, who turn out to be brothers. The men must give up their "secret persona" but they all live happily ever after.