1620s, "convenient sea room" (Bailey's dictionary), for ships or for sailors, a word of uncertain origin, probably from bear (v.) + abstract noun suffix -th (2) as in strength, health, etc. Original sense is preserved in the figurative phrase to give (something or someone) wide berth "keep well away from." Meaning "place on a ship to stow chests and for sailors to sleep" is from 1706; extended to non-nautical situations by 1778.
1660s, of ships, "to assign or allot anchoring ground to," from berth (n.). Of persons, "to occupy a berth" (intransitive) from 1886. Related: Berthed; berthing.