World War I
The first time military submarines had significant impact on a war was in World War I. Forces such as the U-boats of Germany saw action in the First Battle of the Atlantic. The U-boats' ability to function as practical war machines relied on new tactics, their numbers, and submarine technologies such as combination diesel/electric power system that had been developed in the preceding years. More like submersible ships than the submarines of today, U-boats operated primarily on the surface using regular engines, submerging occasionally to attack under battery power. They were roughly triangular in cross-section, with a distinct keel, to control rolling while surfaced, and a distinct bow.
On May 7, 1915, U-20 sank the liner RMS Lusitania. Though there was a great deal of outrage at the sinking of an "innocent" merchant ship at the time, historians now believe the Lusitania had 10 tons of weapons aboard, making it a valid target under international law. Of the 1,198 lives lost, 128 were American civilians, including a noted theatrical producer and a member of the prestigious Vanderbilt family. This event turned American public opinion against Germany and was a significant factor in getting the United States involved in the war on the Allied side.
German submarine U9 (1914)
With the United States already on the side of the Allies, Germany announced on 31 January 1917 that its U-boats would engage in unrestricted submarine warfare. On 17 March 1917, German submarines sank three American merchant vessels. See First Battle of the Atlantic.
At the end of WWI, as part of the Paris Peace Conference, 1919, the Treaty of Versailles restricted the total tonnage of the German fleet. The treaty also restricted the independent tonnage of ships and forbade the construction of submarines. Before the start of WWII, Germany started rebuilding U-boats and training crews hiding these activities under "research" or other covers, so that when WWII started, Germany already had a few U-Boats ready for warfare.
German UC-1 class submarine
Source and more references