What thermal effect does the Sun have on spacecraft that are roughly the same distance from the Sun as the Earth?
Specifically, do spacecraft need to constantly rotate so that one side doesn't get too hot and the other too cold?
It depends on the spacecraft and the instruments on-board. Obviously a spacecraft in direct sunlight will be gaining thermal energy from the sun. However, as it heats up the rate at which it radiates heat will also increase. There are ways to actively or passively control the temperature of a spacecraft; these are called thermal control systems. If none of the systems on your spacecraft are particularly sensitive to heat then you may not need a thermal control system.
Rotating a spacecraft is one way to distribute the heat, but it is more common to use heat pipes containing ammonia to distribute heat from one part of the spacecraft to the other. Other methods of thermal control on spacecraft include having radiator panels (like those seen on the ISS and on RTG's), sun shields, and use of cryogenics such as liquid helium. The James Webb Space Telescope will employ both a sun shield and liquid helium to keep its instruments cold.