parent is changing the problem by suggesting to "pack in the 3rd dimension": lay all the squares on the same square footprint, resulting in always needing only a square with side length 1 on which all the needed "packed" unit squares are laid.
Look at some of the other links people have posted for optimal packings. The optimal 11 square packing looks nothing like what you're describing ("just stack the cubes next to each other").