James F. Dobbins, the veteran diplomat who has served as the United States special envoy for Afghanistan and Pakistan, is leaving government this month Mr. Dobbins, 72, will be succeeded by his deputy, Daniel F. Feldman, whose ties to Secretary of State John Kerry date back to Mr. Kerry's 2004 presidential campaign.