The main function of the legislative branch is to make laws. The Congress, which is what the legislative branch in called in the U.S. Government, also declares war, approves presidential appointments, approves treaties and has other powers and responsibilities.
The legislative branch is the only branch of the government with the power to make new laws or change existing ones. The executive branch can issue regulations, but only under the authority of laws passed by Congress. Laws passed by Congress can be vetoed by the President, but Congress can overturn that decision if two thirds of the House of Representatives and the Senate vote to do so.
Congress gets its powers from the Constitution. Article One gives the Congress its powers and defines what areas it can legislate. Part of this legislative authority is the annual establishment of a budget for the government. This gives Congress the power to levy taxes and tariffs to fund the government. Congress also has the power to borrow money if taxes and tariffs raised are not enough to fund the government.
Another important role Congress plays is oversight of the President and the executive branch of the government. This acts as a check against the President's power and a balance against his ability to enact laws or regulations.