On April 6, 1917, the US Congress approved a declaration of war on Germany and entered the first world war on the side of the Allies. The war broke out in 1914 and the US tried to stay neutral (although we were unofficially sneaking aid to England). Foreign policy of the era was isolationist, a policy many in Congress supported.
The US was bombarded with propaganda from both the Allies and Axis powers. Both sides wanted the US to enter the war and tried all sorts of things to cause public opinion to shift away from an isolationist stance towards taking a side. A few things happened that did cause public opinion to start to shift, including a German submarine sinking the passenger ship the Lusitania off the coast of Ireland in 1915 (over 100 Americans died) and the sinking of the Sussex one year later. (To read an interesting account of the Lusitania and the role its sinking played in the war, visit the blog Lost in the Myths of History).
After the Sussex went down, many Americans were very angry at Germany and some started to favor entering the war. However, their outrage didn’t cause a declaration of war. Later on, the Lusitania tragedy was re-introduced in a very compelling enlistment poster:
President Wilson started to talk tough to Germany and also started to increase the size of the military. He issues a stern warning to Germany:
Unless the Imperial Government should now immediately declare and effect an abandonment of its present methods of submarine warfar against passenger and freight-carrying vessels, the Government of the United States can have no choice but to sever diplomatic relations with the German Empire altogether.
The Germans seemed to back down and stopped submarine warfare for a bit, but in 1917 they started their submarine program back up and cut all ties with the US. Around the same time, British intelligence intercepted messages from the German military to Mexico and Japan. Germany offered to provide the countries with aid if they’d attack the US, presumably to distract us from Germany. When Wilson learned of this diplomatic subterfuge, along with the resumption of submarine warfare, Wilson had enough. He asked for a declaration of war.
To learn more about US involvement in WWI, you can visit the National WWI museum in Kansas City, MO.