The Sculpt Spell metamagic feat allows you to change the area affected by a spell. One of the options you have to change your spell into is "Four 10 foot Cubes". Do these cubes need to be adjacent somehow? And if not, how far apart can they be?
They don't need to be adjacent.
The wording just says
You can modify an area spell by changing the area's shape to either a cylinder (10-foot radius, 30 feet high), a 40-foot cone, four 10-foot cubes, a ball (20-foot-radius spread), or a 120-foot line. The sculpted spell works normally in all respects except for its shape.
At no point does it mention that the cubes need to be adjacent. The general spell rules on area also don't mention this in any way, and every ability that requires areas to be adjacent indicates as such by using the word 'adjacent' or 'contiguous' or so forth. There's no common logic that 'four 10' cubes' must necessarily be adjacent, such that it wouldn't be mentioned.
As for how far apart they can be, anywhere within the spell's Range. You can't target an area of effect outside the Range of a spell, which is the only applicable rule, so you could have them equidistant at max range if you felt like it.