Let the side of the cube be a. The cube built of 8 cubes has a base consisting of 4 cubes of n a 2X2 square and 4 cubes placed on top. The surface area consists of 6 faces each with area 4a^2 (a square with side 2a), so the total surface area is 6*4a^2=24a^2.
A row of cubes is 8a long by a high=8a^2 side area. This is an elongated rectangle with 4 sides having an area of 8a^2=32a^2 in total plus the end faces with area a^2 each, so the total surface area is 34a^2 and this is greater than 24a^2.