There are no brakes on a ship. For a planned stop, engine/propulsion power is gradually reduced and the ship slows and eventually stops through water resistance. In an emergency or for close-quarters manoeuvring the ship can go astern on the main propulsion and drag to a stop, though this depends on the ship and how she is fitted.
I do know that the old QE2 could, if really pushed, reduce speed from something like 32 knots full ahead to standstill in just under 4 minutes, in about three quarters of a mile. Most large ships aren't so vigorous.
I also know of one elderly coaster where they have to actually have to stop the main engine, wait for all motion to cease and then restart it running backwards to achieve any astern power. This isn't quick and harbour masters insist that she has a tug connected up to act as a brake if needed . . .
For a ship to stop, the engine/propulsion power is gradually reduced and the ship slows down until it stops. However, to keep the ship in position, you need to dock it by pulling the anchor off the sea floor. In an emergency or for close-quarters maneuvering, the ship can go astern on the main propulsion and drag to a stop, though this depends on the ship and how it is fitted.