Cosplay has a couple of meanings, but the most relevant is the merging of the words costume and play. If you want to wear a costume while attending an event (perhaps even to compete or to perform a short sketch), then you have entered the exciting world of cosplay.
Wikipedia describes Cosplay as follows:
Cosplay (コスプレ kosupure), a contraction (or portmanteau) of the English words "costume" and "play", is a Japanese subculture centered on dressing as characters from manga, anime, and video games, and, less commonly, Japanese live action television shows, Japanese movies, or Japanese pop music bands. However, in some circles, "cosplay" has been expanded to mean simply wearing a costume.
In Japan, "cosplay" as a hobby is usually an end unto itself. Likeminded people gather to see other costumes, show off their own elaborate handmade creations, take lots of pictures, and possibly participate in best costume contests.
The most specific anecdote about the origin of the word "cosplay" was that Nov Takahashi (from a Japanese studio called Studio Hard) coined the term "cosplay" as a contraction of the English-language words "costume play" while he was attending the 1984 Los Angeles Science Fiction Worldcon. He was so impressed by the hall and masquerade costuming there that he reported about it frequently in Japanese science fiction magazines. This ultimately triggered Japanese cosplay. This point is debatable.
Wikipedia goes on to say that Cosplay in the United States and Europe differs from Japanese cosplay culture in that cosplay concerning Sci-Fi films and TV shows along with Renaissance-era characters, and historical re-enactments (i.e. Civil War battles), especially at science fiction conventions, are far more popular in the West than they are in Japan.
It also mentions that another recent trend in cosplay is a blurring of the distinction between costumes based on characters from games and anime, and "original" costumes based upon a general theme or existing fashions. In particular, the Tokyo teen-fashion trend of gothic lolita has attracted some cosplayers who might not have the inclination to wear such distinctive clothes around town, but who would like to dress in such a manner on some occasions.