If Tim bought 128 sandbags to completely fill a cube-shaped sandbox, and each bag fills a cubic foot in the sandbox, then the number of cubic feet in the sandbox is equal to the number of sandbags.
So, the length of one side of the cube-shaped sandbox, in feet, is the cube root of 128:
Length of one side = ∛128 = 4 feet
Therefore, each side of the sandbox is 4 feet long.