It has to do with the number of dimensions you have in the figure. For example, in a square you have 2 dimensions, length and width. Since you have only two you use units^2. In a cube, you have 3 dimensions, length, width and height, which is where you get the units^3.