Hmmm..... very good question.... I remember Jean-Michel Jarre making a 24-hour piece for some special occasion..... Though, I am not sure whether it was one whole piece or just alot of smaller works put together !?!?
The longest piece of music that I know of is called ‘Olitsky’ (a miss-spelling of the painter Jules Olitski’s name) and was composed in 1987 by, well, me.
It is a pitch-based ‘tape’ piece for sixteen lines of music on four simultaneous tape loops: (a) 44'43", (b) 44'39", (c) 44'46" & (d) 44'54" that has a ‘total’ duration of 1,648,171 years, 7 weeks, 6 days, 10 hours, 23 minutes and 33 seconds. That being the first time the four loops end together and the piece starts to repeat.
The length of around 45 minutes for each loop was simply due to the technology of the time - the only practical possibility was the C90 cassette (the C120 was too unstable), these days I use CDs as the time frame. The original '87 version actually failed the intention as the fade-ins and outs were too long and created an apparent hole, thus seeming to 'end' the piece after the first 45 minutes, so when re-mastering in ‘99 I edited the tracks to create a true overlap, the first repeating notes becoming part of the last chord of the next longest loop.
For this piece I produced a circular score using time-space notation (only note-heads - sharps shown as semibreves) with the staves on the background and the note-heads on four moveable transparent sheets. Each sheet is moved the appropriate distance over the staves at the end of each loop's cycle to place the beginning point at the previous end point.
The first few hours of Olitsky was first performed in the foyer of the Lyons Concert Hall, York, England, 11 March 1989.
Longest perhaps but I wonder how many of them were seen as being of good quality. To be honest I don't think anyone would have a problem creating longer and longer compositions but the quality would most certainly suffer. Also my attention span can only take around 45 mins at a time so that would be tops for me before I switched off.
According to the wiki the longest piece ever created, at a whopping 639 years long, the longest piece of music in the world is.........Organ2/ASLSP by John Cage.
Also the long one is Richard Wagner - Der Ring des Nibelungen, that damn thing was listened by me, and it was long as hell....29 hours, in total, but there was a thought that the life was passed or even two....thus the opera itself is fantastic, and also fantastically loooooooong