That is a really open ended issue.
Writing a song can be anywhere from 45 minutes (I think that's the quickest I've written one) to many weeks or never.... generally the writing process is a day or so in length for the first draft..... then it may be weeks to re-write the song several times to end up with what is considered to be the "final version".....
Recording..... another open ended issue. Is a recording ever truly finished? Some would argue "no", but I like to say there is a point where I'm not willing to put any more effort into the project, and that's when I call it finished.
The shortest new project to done for me was 4 hours give or take. However, most often, again, the recording and mixing process often takes several days to a few weeks depending on numerous factors. I can easily spend days on end obsessing over the minutia in the project.
That said, most of the projects I work on are "start to finish" probably in the range of about 2 to 3 weeks including the writing and recording. (Whether that is consecutive is another story)