When you read about solar systems, especially solar thermal and passive systems, you may come across the "10-Degree Rule". The rule states that, wherever possible, a building should be constructed with the long axis facing within 10 degrees of true south (not magnetic south).
The reason for this rule is very simple: south-facing walls get the most sun (in the northern hemisphere). You want as much of a building as possible facing that way to gather as much heat and energy as possible.
Of course, it's not always possible to site your home precisely on an east-west axis so that your longest wall faces south. Considerations such as street layouts, views across beautiful vistas and retrofitting existing homes may make it impossible to achieve the perfect alignment.
Solar gain drops off as the distance from true south increases but isn't drastically affected until you reach quite significant angles. For example, at around 20° off axis your home will still get over 90% of the available solar radiation; at 45° off axis, you can only hope to gather about 70% of the available energy.
However, there is another side to the 10 Degree Rule: the more you deviate from it, the more the east and west sides of the house are exposed to the sun early and late in the day in summer. This means that the home not only gets reduced heat on the southern face in winter, but that the building can be baking hot in summer, when the extra exposure on the sides becomes problematic. This is especially true when the house is turned southwest.
There are ways to work around this, of course. For example, if a particularly inviting view tempts you to align the home north-south, you could consider an L-shaped layout, with the short arm of the L pointed to the view and the long arm gathering solar energy. If that's not possible, you could keep the building on an east-west axis and just ensure that important rooms – living rooms, bedrooms and so on – have windows on the view so that its value is not lost.