We have an idea of how social media has changed the music industry but it seems to even affect the duration of standard music.
The answer to what is the best length for your song is.. it depends. If it is a traditional pop song, most data tells us that in 2020 3 min and 17 seconds is the ideal but if you are making a song focusing on social media exposure only, there has recently been a trend with very short songs varying from 1 to 2 minutes.