It all depends on what you consider my "first song." The first lyric I ever wrote to music added lyrics to the instrumental song "Sylvia" by Focus on their "Dutch Masters" album. Took about two hours. It was a terrible fit with the instrumental, but the lyric eventually made a good song. The vocal just followed the instrumental melody note for note, so one could not really say that I "wrote" that melody. That was around 1975.
The first song I ever wrote found a vocal melody of my own for was a preachy, long winded, overlong song called "The Fool That I Was." Wasn't good enough to ever put music to. It took about six hours, including lyrics. That was probably around 1988.
The first instrumental I ever wrote (and the first music I ever created from scratch) is a little, happy instrumental called "Andromeda's Moon." I had just gotten a notation software, and just started pulling notes onto the staff. Surprisingly, it turned out. No one who has heard it has failed to like it, and every attempt to "improve on it" makes it worse. It took about an hour and a half. It's still one of my favorites. That would have been around 2007 or 2008 around Christmas.
The first song I ever created from scratch, music, lyrics, and all was a song called "Ode To Mary Carolyn." It took about three hours. I began with the sheet music from "Crimson and Clover" and deconstructed from a three measure set of notes that sounded pleasing, and then worked forward and backward from those three measures creating new combinations of notes that sounded right with the adjacent measures until it sounded right to me. Took about two to three hours for the instrumental, then another two or three hours (spread over several days) to find the right lyric. December of 2007 or 2008. Easy to remember, because I bought myself the software as a Christmas present to self.
First song I ever wrote from scratch without having an existing template to work from was a simple little agnostic song called "I don't know." I still like it. . . but no one else ever did. Not surprising, since I still didn't understand that chords existed, much less that their was a way to put them together, and a way to avoid putting them together. Didn't take more than about 45 minutes front to back.
It's hard for me to say which of these was the "first song I finished." Or "when I started writing music."