I know a definitive end has never been written for the Great War and G1, but by the time we get around to Beast Wars, we can assume that Optimus Prime isn't around.
So where is he and what happened to him?
We have to delve into the realms of the non-canonical and conjecture.
Furman's Alignment comic says Prime is in some kind of Stasis after being damaged in the defeat of Galvatron and isn't present at the battle at the Hub.
And then in Furman's The Last Days of Optimus Prime, we have Prime travelling to J'nwan and to peace in the Allspark or Matrix or whatnot becuase he feels his place isn't in this new, post-upgrade, world.
But surely there is a little more to it than that.
For millenia, Prime has been the leader of the Autobots, but now in peace, control must be handed back to the Politicians, in the form of Ironhide, Prowl and Silverbolt of the Maximal Council, who now lead the newly created Maximal faction.
The Matrix (the one in Prime's chest) is never spoken of to exist in BW times. Big Convoy and Lio Convoy are said to have an Energon Matrix each, but this is different to the 'Light your Darkest Hour' kind of thing.
What do I think happened?
Prime is in Stasis, but his core consciousness is accessed and discussion is had with him. He hands (figuritively) power back to a Governing body, then asks that his body is taken to Vector Sigma.
The key for Vector Sigma has long since been destroyed, but the Matrix Holster in his chest is of early Cybertronian making, and will suffice as a key (just like Alpha Trion did by putting himself in it to get Vector Sigma to work ages ago) and so Prime goes in, and by doing so, opens channels that allow new Sparks to be released and new Transformers to be created, to repopulate Cybertron and start the Great Upgrade, as each new 'bot is put into a Proto-matter body.
The Matrix is retired, Prime saying that Primus whispered in his ear that it won't be needed again, though very dark days are ahead, but a new light will present itself. He created an Energon Matrix, which he says to give to a Maximal soldier called Maxim, who upon receiving it becomes Maximus Prime (Big Convoy, with a more anglo name).
Prime joins his old buddies in the Allspark and is at peace, but can be contacted on a toll free number than the Maximals have if they need help.
That's just how I see it anyway.
Other ideas?