A wharf is a man-made structure on a river or by the sea, which provides an area for ships to safely dock. Some are very intricate, with multiple types of berth over a large area, and navigable channels, and others are more straightforward. A Wharf can contain quays and piers and will normally have buildings within it to service the ships (often warehouses and offices). A wharf is for the commercial unloading and loading of ships and is (usually) private property belonging to a shipping company.
A quay (pronounce key) is for smaller ships or boats and is available for general use, these are frequently owned and operated by the local governments/councils for the benefit of local fishermen originally. Passenger ships would usually dock at quays, cargo ships at wharves. It is, technically, a part of the river bank or coastline which has been modified so ships can dock at it parallel to the shore.
A pier is a man-made construction which protrudes from the shore at a level above the water level, allowing ships to disembark passengers in the deeper water further out. The length of the pier may also provide berths for smaller boats. This allows two or more ships to unload simultaneously in the land area that one would otherwise occupy.
A jetty is a structure that projects from the land out into water. Often, “jetty” refers to a walkway accessing the centre of an enclosed waterbody. (Usually, a jetty is a structure of wood or stone extended into the sea to influence the current or tide, or to protect a harbor or beach while a pier is a raised platform built from the shore out over water, supported on piles; used to secure, or provide access to shipping.)
A berth is simply the space that could be occupied by one ship, it is not a fixed size, but would rather depend on the size of ship usually found in that place. A container ship would occupy the berths of four or five trawlers, but whilst it was there it would only be one berth.