She lives there(!)
Kara operates out of National City because she lives in National City, in the city nearest to where she grew up (replicating Superman's transition from Smallville to nearby Metropolis). Her secret identity is completely established before she becomes a superhero and despite having the ability to fly at high speed, it makes good sense for her to be able to return to work within a few minutes, allowing her to transition from Supergirl to Kara and back within minutes.
She's only a learner
Despite her great powers, Supergirl is mindful of the fact that she's not (at least in the first season) an especially competent operator. It makes good sense to establish herself as the protector of National City while leaving the national and international problems to her cousin, Superman. The clear delineation between his and her responsibilities also prevent them from treading on each other's toes when a disaster occurs.
National City has plenty to do
National City is close to the crash-site of Fort Rozz and, we learn in Season 2, a popular destination for aliens hiding out on Earth. It also seems to have something of a crime problem. Combined with it being near to the DEO (which Kara works for) and the HQ of
EvilCorp LexCorp and there's more than enough to keep her busy on a pretty much full-time basis.
It could confuse viewers
Although New York is an iconic location, there have been a number of recent properties (notably the Avengers) based in the city. Placing a new superhero show in New York might lead to casual fans becoming confused as to why superheroes from other studios aren't helping out when disasters occur.
It's made in Vancouver
Placing the action in a fictional American city gives the makers free reign to play with the buildings, skyline, locale and setting without having to constantly justify why New York looks so much like Vancouver (the actual filming location) and why it's suddenly next to a desert, an ocean with a deep-sea port and a major river system. There's also the fact that American audiences would be likely to respond less well to such an iconically America superhero operating out of Canada.