Sunshine, in the OED, means 'sunlight unbroken by cloud'
But when the word sunshine is used in songs it hardly ever means sunlight at all. It's more likely to mean cheerfulness.
Cheerfulness is officially acknowledged in OED
as a meaning of sunshine.
Such meaning is also acknowledged in the OED in the phrase ray of sunshine, meaning
a person who brings happiness to others.
Caricature of the film Little Miss Sunshine
Notice: sunshine above also means bringer of happiness. This matches the use of sunshine in My Girl - song by The Temptation from 1964. The words in the song explicitly states talking 'bout my girl.
Sunshine 'n cheerfulness/happiness, or bringer of happiness,
|Sunny Day in May - Hyde Park (Leeds)|
|Reality Series from BBC Three|
If you're a UK or US native speaker of English, you're probably used to lower temperatures most part of the year. Sunshine, then, is a sign of comfort, as opposite to a chilling shade spot, or a cloudy cold day.
Thus, sunshine often brings about unconscious associations with positive feelings.
Even native speakers of English who don't realise such association through their own geographical experience, must be used to such positive associations. This happens, I assume, because they grow up hearing such word used in positive contexts.
The case is different for learners of English who happen to live in areas where sunshine is just an ordinary feature of the weather all year long - equatorial regions.
Here, sunshine may be mostly associated with high temp,
and be a sign of discomfort, of continuous heat.
|Heat in Urban areas, and also in Backland / Outback areas.|
Whereas a shade spot, or a cloudy day, is a sign of relief.
The same probably is extended to related words, like sun, sunny, shine, hot, warm, warmth, and the kind.
So, next time you hear suchlike words in a song, poem, advert, whatever, pay attention and realise more consciously if they are used with a more or less literal meaning.