Only when written 歌 / 唄
The ordinary word for a song or the act/sound of singing. 唄 is especially associated with folk songs and shamisen or traditional singing.
I have known this song since I was a child.
祖母は古い唄を小さな声で口ずさんだ。
My grandmother softly hummed an old folk song.
classical Japanese poem; tanka
Only when written 歌
Used for classical Japanese verse, especially tanka; common in literary and historical contexts such as anthologies.
See also: 短歌
万葉集には多くの歌が収められている。
Many poems are included in the Man'yōshū.
Only when written 歌 / 詩
A literary use referring to poetry rather than music. The spelling 詩 with the reading うた is poetic and can be ambiguous because 詩 is usually read し.
彼の歌は、現代詩として高く評価されている。
His poems are highly regarded as modern poetry.
詩集の題名にある「愛の詩」は「あいのうた」と読ませている。
The phrase 愛の詩 in the poetry collection's title is intended to be read as ai no uta.
She sang a song on stage.
She composed a tanka poem while looking at the moon.
He composed a song for his friend.
歌 is the everyday, general word for a song, while 唱歌 usually points to a simple, school-style or old-fashioned song.
歌 is the general word for a song of any kind, while カンツォーネ specifically means a song in the Italian popular/lyrical tradition.
singing contest; singing match
song parody; new lyrics to an existing melody
humming; crooning
love song; love poem
imperial poem; poem by the emperor or imperial family · poem; song (honorific)
poetry gathering; tanka party; tanka competition
poetry contest
children's song; nursery rhyme
counting song · enumerative form (of waka)
break into song; burst into song; begin singing
sad song; lonesome singing
original song
Chinese poem; Chinese-style poem
overtone singing; throat singing
court song for religious services and celebrations
Heian court lady's song; kouta (accompanying ōuta) · popular short song; ditty; ballad (Muromachi to early Edo) · kyogen kouta; love ballad in kyogen · noh kouta; unusual noh song style
Azuma-uta; old Kanto-area folk songs
tanka poet; skilled tanka poet · court poetry official (ritsuryō) · poet (general)
flute mouthpiece; blowhole · poetic style; manner of singing
Attested spelling for poetry, but 詩 alone is more commonly read し; the reading うた is literary or title-like.