@cscottrun4it Youre comment kept me up late at night, so I had some quality time to think about it. I think in order to find a definitive answer to this question we must first ask ourselves: What is an opening? For me the meaning of the opening is the phase in the game where you develop your pieces. The moment you have developed all your pieces and castled your king is normally the moment you connect your rooks but obviously this is not a definitive answer. For example 2 amateur players might open their game like this 1.a4-a5 2.h4-h5 3.Ra3-Ra6 4.Rh3-Rh6. Now, both players have connected their rooks, be it on the 3rd and 6th ranks but still they are truly connected... Obviously no one in their right mind would consider the opening stage to be over at this point.
Sometimes when I play a studend I move my knights back and forth to give them time to develop some or sometimes all of their pieces to show them the strenght of a fully developed position. In that case I would consider 1 player to have reached the opening phase but the other (me who has the exact same position on move 10 as on move 1) to never have reached the opening phase. Still I would consider it the opening phase as long as atleast 1 of the 2 players is developing his pieces.
Having said that, what about a game where both players just start moving their knights back and forth, or maybe just dance around the board for 20 moves only to find themselves back at their starting squares a move later and agree to a draw on the next move?! I would say that eventhough a game like this would have 20 or more moves it never even reached the opening stage. Another fun idea would be that in the earlier mentioned game, the players didnt agree on a draw on move 20 but started playing an actual good game from that move. Then I think one can safely say that the opening of that game didnt start on move 1 but on move 20.
Joking aside, I think there is another way of determinating when an opening is actually over. And to get there I think we should change the question from where does an opening end to where does the middlegame begin? Having thought long about this question too I think my answer would be, that that is the moment where 1 side switches from the idea of developing to attacking! A good amount of games are played where one side starts attacking without having developed some (or sometimes almost all) pieces. For example in the French Winawer variant where white doenst move the bishop on c1 and the rook on a1 at all, the same goes for many other opening variants where the pieces are best developed on their starting squares. Ofcourse these games still have opening, middle and-endgames.
I think there are other ways to determine where the opening ends and where the middlegame begins. And although this could be a single point in time one could also think of it in this way; opening phase -> transition phase -> middlegame. I think that this is a very important idea of looking at the problem. For example if we translate the problem we have here to for example evolution, one might ask the question; where did homo erectus end and homo sapiens begin? The answer to this question is that there wasnt just 1 moment in time where this happened. There wasnt 1 homo erectus that had a homo sapien baby but it was more of a slow gradual process that transformed our species from opening to middlegame.
PS: Altought the transition from opening to middlegame can be marked as a point in time, i do not think that the time spend by the players is relevant to this question. The moment in time is linked to the position the players reach at that period in time and the position is the thing that should determine where the players are in the game.