How to keep a downspout extension from coming off?
White sheet metal screw through the overlapped sections. Or if you want to get fancy, a pop-rivet (converted from my comment).

Note to Jack - some of the other SE sites seem to discourage 1 (or 2)-sentence answers.  I have been asked on at least one occasion to convert an answer into a comment.