WASHINGTON — President Trump has given Defense Secretary Jim Mattis the authority to determine troop levels in Afghanistan, three administration officials said Tuesday, opening the door for sending more American forces to a war that the Pentagon chief acknowledged the United States was “not winning.”

Mr. Mattis is believed to favor sending several thousand more American troops to strengthen the effort to advise Afghan forces as they push back against gains made by the Taliban, the Islamic State and other militant groups. But officials said he had not yet decided how many more forces to send to Afghanistan, or when to deploy them.

One United States official, who spoke on the condition of anonymity because he was discussing internal deliberations, said that Mr. Trump decided on Tuesday morning to grant Mr. Mattis the authority. It was the latest in a series of moves by the White House to give the Pentagon and its military commanders more latitude to deploy forces and carry out operations.

Mr. Mattis alluded somewhat cryptically to the decision when he testified on Tuesday morning to the Senate Armed Services Committee. During his appearance, the defense secretary promised Congress that the Trump administration would develop a new strategy for Afghanistan by mid-July to turn around the war.