It's a careful balance of script, story and finances. To some degree, you have to have a movie that's watchable. People's attention spans just aren't set at Gone With the Wind length anymore. Like that old Billy Joel song "The Entertainer" quips, "It was a beautiful song but it ran too long, if you're gonna have a hit you gotta make it fit, so they cut it down to 3:05".
If you're storyboarding a movie and it looks like it's going to push 3+ hours, you have to decide if you want to tax your audience that much. However, you also have to take into consideration your target audience. In instances like The Hobbit, Harry Potter and Hunger Games, all those franchises have huge followings. The fans are already invested in Hunger Games and the LOTR series, so you know you can make money on the last pieces of the puzzle by having multiple movies instead of a single one. People are going to come and see them, because they've seen the rest of the movies. So, as you approach the 3 hour barrier, it's safe to say you can double your money by cutting it into 2 movies. I'm sure the thought process was identical with Harry Potter.
Notice, however, that those multi-part movies are usually the last in the series. They could have easily split The Avengers into 2 movies with its 2.5 hour run time by padding each half a little, but what if the first one flopped? You have a second movie that no one will come see.