The last two posts are, of course, correct regarding the use of the word in describing the military function of a vessel. (I've never encountered the word "brig" in reference to a vessel with more than two masts, but I wouldn't be surprised if it got used that way.) Much of the confusion, though, comes from the fact that the word "sloop" was also used to describe a RIG - whether in the navy or the merchant service.
A single-masted, square-rigged naval vessel commanded by a lieutenant would be referred to as a "sloop." If the same vessel was commanded by a commander (who would indeed be a "master and commander," since he commanded the ship - but wouldn't necessarily be addressed as "master" if he didn't) it would be, technically, a "sloop-rigged cutter" (unless it had a shifting bowsprit, in which case it would be, I suppose, a "cutter-rigged cutter"). But two contemporary documents might refer to that vessel as either a "sloop" or a "cutter."
That word "cutter" is almost as bad. It refers, in various contexts, to (1) a small boat with notches in its gunwales instead of oarlocks, (2) a single-masted, square-rigged vessel with a shifting bowsprit, (3) a single-masted, square-rigged warship commanded by an officer with a rank higher than lieutenant - and (4) a vessel of the Revenue Service, regardless of rig. In 1790 the U.S. Congress, presumably borrowing British terminology, authorized the construction of thirteen "revenue cutters," thereby establishing the "Revenue Cutter Service" (or "Revenue Marine"; nobody was picky about that terminology either), the first predecessor of the modern U.S. Coast Guard. Nobody batted an eye when those "cutters" turned out to be (in terms of rig) schooners. And today's Coast Guard, of course, uses the word "cutter" to refer to any vessel (other than a tender) that's more than a hundred feet long - including the U.S. Coast Guard Cutter Eagle, which is a three-masted barque.
All this stuff is interesting and fun to mess around with. In recent publications, though, I've noticed a tendency on the part of erudite authors to suggest that all this terminology was used with great precision in the eighteenth century. It wasn't. The private letters, official reports, orders, etc. written by eighteenth-century British naval officers were pretty sloppy in their use of teminology. (They used the phrase "H.M. Sloop," for instance, quite casually; you have to look up the vessel by name to find out whether they're talking about a vessel with one mast or three.)
Most of the research I've done myself in such documents dealt with the American Revolution. I have the general impression that the jargon of British naval officers did get more precise during the next few decades, but I don't think those guys were ever as meticulous in their use of the language as some of the modern writers would have us believe.
I've never become even remotely literate in nautical-speak in any language other than English. I wonder whether French or Spanish - or, for that matter, any of the Asian languages - has created such an impenetrable morass of jargon to talk about ships as English has.
Fascinating, frustrating stuff. It's neat to have a forum like this in which to talk about it. Back in the real world, if I can convince my colleagues and students that there's a difference between a ship and a boat I feel like I've accomplished something. (The chair of the history department where I work once came back from a vacation trip to England with a photo of what he referred to as "the ****** end of H.M.S. Victory." Not having tenure at the time, I just smiled.)