Boxes are measured from the inside. The dimensions are related to the opening of an assembled box.
The depth is sometimes considered the height. A box is measured by Length x Width x Depth (height). The width is always the shortest dimension, and the length is always the longer dimension, along the opening of the box.
The depth is the distance between the opening (top) and the opposite panel (bottom).
If measuring the inside of an existing box, make sure to measure from the center of the score (the crushed fold line). A good trick is to fold the board inward and draw a line in the crease. Then measure from the drawn line, to line.
We refer to the inside dimensions because the corrugated board thickness may vary. A box constructed of B Flute will not have the same outer dimension as a box made from E flute.