Remember that NPCs are people, not info dumps.
Your players are following what I'd call the video game model of NPC interaction. In a lot of RPG video games, the NPCs are infinitely patient and let you talk to them over and over, exploring all of their dialogue trees. Thus, the incentive for the player is to talk to them forever to get all of the possible information that the NPC knows.
However, in D&D, there's an actual person behind each NPC, and not just a dialogue tree. Therefore, you can respond as a person in a real conversation, instead of an infodump.
In my games, I accomplish this by giving each NPC a starting disposition toward the party and at least a skeleton of a personality. These things determine how an NPC is going to react and how much information they're willing to give. For example, a bartender might start off friendly, but if the PCs keep probing and pushing, he might become increasingly annoyed and hostile to the PCs. On the other hand, a kindly quest-giving wizard might be patient enough to tolerate any amount of questioning from the PCs.
Because you're playing a game, I find that I have the best success when these personality traits are exaggerated. For example, while a real-life bartender might only be subtly exasperated, your in-game one might become openly rude. In this way, you can give your players obvious social cues for when conversations are over.
It takes some time for your players to learn that social interaction in D&D is not the same as in video games, but they will figure it out over time. However, if you yourself are getting exasperated, you can always go for the brute-force strategy, and simply say something like "This NPC is not willing to tell you more," or "He doesn't know any more".