Two system tiles are adjacent to each other if any of the tiles’ sides are touching each other. A system that has a wormhole is treated as being adjacent to a system that has a matching wormhole.
Specific card abilities may override the general rule.
LRR v2.0 (base game / Prophecy of Kings); specific card abilities may override the general rule.