By convention the longer side is called the length, but it
doesn't have to be.
Consider a rectangular window:
If you were to buy a blind for a window, the length of the blind
would correspond to the drop from top to bottom of the window, and
the width of the blind would correspond to the distance from side
to side. If the window was a short, wide window the width of the
blind would be longer than its length!