The two blocs were the Central Powers and the Allies
The two power blocs of World War 1 were the Central Powers, led by Germany and Austria-Hungary, and the Allies, led by Britain, France and Russia. Most of the major European countries ended up in one bloc or the other, and both blocs drew in countries from outside Europe too.
Prewar groupings: Triple Alliance and Triple Entente
Before the war, the groupings had different names. Germany, Austria-Hungary and Italy formed the Triple Alliance in 1882. France and Russia had a military alliance from 1894. Britain then reached agreements with France in 1904 and with Russia in 1907, and historians call the links between the three the Triple Entente.
“Entente” is a French word meaning understanding or agreement. The name suggests that these ties were looser than a formal alliance, which is accurate for the British agreements in particular.
How the wartime blocs differed from the prewar ones
The wartime blocs were not identical to the prewar groupings. Italy, a member of the Triple Alliance, stayed neutral in 1914 and then joined the Allies in May 1915. The Ottoman Empire and Bulgaria joined the Central Powers. Japan, Portugal, Romania and the United States joined the Allies.
Why Italy did not fit neatly
Italy argued that its alliance with Germany and Austria-Hungary was defensive. It said the alliance did not require it to join a war that Austria-Hungary had begun. In 1915 the Allies offered Italy territory in a secret agreement, the Treaty of London, and Italy joined them.
Italy’s switch is the clearest example of why the two-bloc picture is a simplification. Alliances were built around interests, and they could change when the terms on offer changed.
Neutral countries
Not every country picked a side. Spain, the Netherlands, Denmark, Norway, Sweden and Switzerland stayed neutral for the whole war. Their neutrality is often overlooked when people describe the two blocs.
What the two-bloc picture leaves out
Empires and colonies complicate the picture further. Australia, Canada, New Zealand and India fought as part of the British Empire on the Allied side. The Central Powers had colonies too, but these were largely lost during the war.
For the bigger picture of how each side was built, see the power blocks of World War 1 overview. Which countries counted as major powers is a separate question, and it is covered in the answer to “What are the great powers in WW1?”