In sailing terms a sloop is a word derived from the Dutch sleop, which in turn was derived from the French "Chelope" 9not sure of the spelling). They referred to small single masted vessels in which the foresheets were inher4ently smaller than the main rig. In the 17th century the French developed the sloop concept for fast blockade running ships with variable rigs really. But they generally retained the idea of small, fastt, lightly armed high powered warships.
In modern naval terms, "sloop" is not a well defined term. And it varies from navy to navy and nation to nation as to what is meant by the term. But in general it refers to small lightly armed warships, somewhere between a frigate and a corvette. Typically they have lost their speed advantage, but reatain relatively long range, and have become mostly ASW platforms...
Sloops vessels were common during the age of steam, but ships of this type were becoming obsolete by the Second World War. The Royal Navy used sloops, revived the sloop as a quick fix to the ASW escort role which had been badly neglected, and used them in numerous roles, including both fleet and convoy escort duty.
More modern defintiions are perhaps, Corvette and Frigates. In the RN, frigates are larger, more capable ASW vessels. I would consider frigate appropriate to apply to ships less than 28knots speed, in 1000-2000 ton range. Corvettes are smaller, and usually somewhat slower, so as to retain adequate range and endurance. Typically they would be 500-1000 tons, with top speeds of about 20 knots, but with considerable range.
Other navies might have different classification criteria, Its a loose categorisation process. No single answer, and no right or wrong answer