The short version, generally true up until a bit after 2000, was the Marvel Comics mostly used real places – Peter Parker is from Queens, for example – and DC Comics mostly used made-up places. DC has started using more real places in the last twenty years, but the book cover above is, at best, confusing. If Gotham City isn’t already New York, then what is it? To make things more confusing, the people behind the recent DC movies claim that Gotham is in New Jersey and across a river from Metropolis, which either makes Metropolis into New York or Philadelphia. Even better, since the first two Batman movies made by Christopher Nolan used Chicago for on-site filming, there are people saying that Gotham must be Chicago, even though (a) the third Nolan movie was shot in New York and (b) people in the comics regularly leave Gotham by ship for Europe.
The easiest way of seeing what was intended is to look at the name “Gotham.” First, literally, it’s Goat Town: “ham” means town in old English. Second, there are stories about a village called Gotham, full of fools, dating from the Middle Ages. But the New York connection is easy to pin down: Washington Irving used it as a name for New York in 1807, transferring the village of fools across the Atlantic. Ever since, the name has cropped up in various businesses in New York. Of course, since the name was used for Batman’s hometown in 1940, we have the cycle of life imitating fiction imitating life imitating fiction. If you name something Gotham today, people will immediately associate it with Batman, not Irving.
The best explanation I’ve heard of what the writers at DC were thinking some 80 years ago is that Metropolis is midtown Manhattan during the day and Gotham is everything else in New York.