Longer labels will result in wider buttons. The vertical size of elements inside a horizontal box are not determined this way however. The buttons will be given heights which fit the full size of the box. Each button will have a width that just fits the text. However, if you change the size of the window, you will notice that the height of the buttons grows.
Horizontal boxes make their children stretchy vertically.
Notice in the image how a suitable horizontal size has been selected but the vertical size changes as the window does. Vertically oriented boxes do this as well, but in the opposite direction. The vertical size is determined by the element. There will be times when you do not want this behaviour. The attribute autostretch of the box controls this.