Simply put, “cosplay” is dressing up as an identifiable character or object from fandom. It’s a way to promote a character or fandom you like, or even a character that would just be fun to dress up as. Cosplayers are most often found at ComicCons, Anime conventions, and media specific conventions. You’ll even occasionally find cosplayers dressed up and wandering around town just for the heck of it, or at cosplay events at comic shops.
Convention attendees have been dressing up, or “cosplaying” since the beginning of the idea of conventions, when it was simply called “dressed up”, or “masquerade”. Rob Hansen’s extensive online science fiction history archive features articles that include photos (warning, some may be NSFW) of masquerade and cosplay at Conventions going back to 1939. The only thing that’s changed over the years is the type of camera used to take the pictures.