A sloop can refer to two separate classes of sail-powered vessel.
(1) Historically, from the late 17th century the Royal Navy used a small two master, rigged either like a ketch or brigantine and formally known as a “sloop of war". It carried up to 12 small cannon, and was rated below the 6th raters. Later, in the middle of the 18th century, 3 masted sloops appeared with 16 guns. In the age-old tradition of naval lack of logic, it soon became a matter of the rank of the commander as to whether the vessel would be considered a “sloop” or brig (or exactly what sort of sloop or what sort of brig.)
(2) A sloop is a single masted sailing boat – your standard, common, popular cruising or racing yacht. Sloop rig refers to fore and aft sails, consisting of a triangular foresail, attached to the mast and either the bow of the boat, or an extended spar (bowsprit); and a larger mainsail, either gaff- or Bermudian-rigged (see Note below).
Historically, the rig has varied a bit over the centuries, according to the use of the craft - coastal trade, pleasure, racing, war, fishing - but has been essentially similar to its current form.