In attempting to answer this question, it is hard to be precise. According to Google, in casual use, the word boat is often used to refer to any water-going vessel, regardless of its size or how it's powered. However, large ocean-faring watercraft—those that use multiple sails or engines—are more properly called ships. Other definitions refer to sailing ships as having bowsprits and multiple masts, or masts with multiple sections. However, modern racing yachts (boats) employ multiple sails, and the use of bowsprits is returning as they are employed to handle large reaching sails.
Another term used to try to distinguish a sailing boat from a sailing ship was ‘ocean-going’, but large racing sailing yachts, also referred to as ‘boats’, regularly make round-the-world voyages, often non-stop. They could hardly not be referred to as ‘ocean-going’. In the age of the Great Windships, there would have been no point in such voyages: they were merchant ships that earned their living taking goods and people to and from one port, or another.
Generally, the word ship isn't commonly applied to smaller craft. A general rule might be: you can put a boat on a ship, but you can’t put a ship on a boat. In the great age of sail, as described in The Great Windships, sailing ships might carry several boats, which could be sailed or rowed. They were used to get ashore, to other ships, bring stores aboard, to explore potential anchorages, chart coastlines, or as refuges when the ‘ship’ had to be abandoned. A case in point would be in Joseph Conrad’s novel, Youth, where the ship caught fire and the crew had to retreat to the three boats carried on board.
Again, in casual usage, the term ‘sailing boat’ is often used to distinguish a small watercraft from power boats (aluminium dinghies powered by outboard motors) and motor yachts with diesel engines, similar to those employed in motor trucks, both of which generally rely entirely on engines for propulsion. Nevertheless, modern yachts (as opposed to the smaller sailing ‘dinghies’) are also most often equipped with (generally smaller) diesel engines. But in maritime terminology, there are always exceptions. A large sailing boat that is equipped with both a sizeable engine and with a competent sailing rig, will most often be referred to as a ‘motor sailer’ – a hybrid. It can proceed under either or both methods of propulsion, depending on the weather conditions or the skipper’s inclination. A motor yacht, on the other hand, will proceed entirely under its (usually diesel) engine or engines.
Thanks to the enormous flexibility of the English language, all of these are can be referred to as ‘water craft’, although very large craft are generally referred to as ‘vessels’.
The question then arises as to why submarines are called boats and not ships.
Using the above guidance, submarines are technically ‘ships’. Yet they are traditionally referred to as ‘boats’. The reason appears to be that originally submarines were very small and manned only when in use, so ‘boat’ was appropriate. Another reason offered is that they only had one deck. Modern submarines, however, mostly have two main decks – an upper and a lower. Thus, as they developed into larger vessels—and rightfully should have been called ships—the original term stuck.