In theory, only Congress has the power to declare war, as written in Article I, section 8 of the Constitution. The President of the United States is the Commander-in-Chief of all US military forces once deployed, but is only authorized to deploy them with Congressional approval.
In practice, the President has almost total authority over military action. Formal declaration of war almost always comes after hostilities have already started at the President's order, if at all; and even if Congress refuses to authorize war the President will often continue prosecuting "proxy wars" and "shadow conflicts" that involve covert operations and targeted airstrikes but do not officially rise to the level of "war" per se. Usually these military actions are authorized by a "use of force" declaration, which is weaker than a true declaration of war.
How did this come about? It was a long historical process, but the turning point was at the end of World War 2 and the rise of nuclear weapons. With the rise of nukes and other high-tech weapons, war could now occur on so fast a timescale that it was considered unreasonable to expect the President to take the time to consult with Congress before taking actions. So the President was then authorized to take action in "national emergencies" and then was supposed to report to Congress within 60 days to get the necessary authorization (this codified in the War Powers Act of 1973).
But even that has not been good enough for most US Presidents; Presidents Ronald Reagan, Bill Clinton, and George W. Bush all initiated military actions without the approval of Congress that were not reported under the War Powers Act until after 60 days had elapsed. Clinton brought the War Powers Act to the Supreme Court, and they ruled in his favor and substantially weakened the Act's enforceable effect.
Today, the War Powers Act is treated more like a formality, a reporting requirement that the President must undertake while he effectively deploys military force around the globe unilaterally. Some people believe that this is necessary, that without it we would not be capable of the rapid response that modern asymmetric warfare requires. Others argue that it is Unconstitutional, and grants too much unilateral power to the President. Either way, the de facto situation is clearly that the President starts wars, and then Congress declares them later.