Did American Pie have to license the name from Don McLean in order to call the movie American Pie, since the title was taken directly from the song?
Maybe. We don't know the details but according to a press release:
Singer-songwriter Don McLean, whose song "American Pie" is among the most popular in pop music history, issued a statement today through his attorney regarding the motion picture of the same title. Said Bert Deixler, of the Los Angeles law firm of McCambridge, Deixler & Marmaro: "I wish to state on Mr. McLean's behalf that, in response to many inquiries from fans throughout the world, neither Mr. McLean or his song are related in any way to the Universal motion picture "American Pie." However, Mr. McLean, as the owner of the title, came to an agreement with Universal with regard to the use of his trademark. Mr. McLean adds that he has not seen the motion picture."
Whether they had to would have been up to a jury had McLean sued. Trade mark and copyright law is complicated like that.