When does the middlegame end and the endgame begin? Is there any specific point where the middle-game ends and end-game begins? E.g. after x number of pieces are exchanged, or say 40 moves, etc.
There isn't a clear-cut definition of endgame, or a set of criteria where you could draw a line and say "after this move, we have reached the endgame."

Quoting Glenn Flear in his excellent book Practical Endgame Play - Beyond the Basics:


  The word 'endgame' is widely used and generally implies the final phase of the game  (however long!), assuming that there already has been significant simplification.  If we had to define the word more rigorously in terms of material then opinions vary.  Some specialists consider all queenless positions to be endgames, others those where both sides have limited material, for instance less than queen and rook.


So basically, once the position becomes 'simplified' to the point where more often than not you are using your few remaining pieces (including the King) to try and queen a pawn, rather than organize an attack.  Also included would be the end result of queening a pawn (or winning significant material), i.e. positions where you mate the King with only a few pieces on the board, like King and Rook vs. King.