The Geneva Conventions set the standards for humanitarian treatment of people in time of war. They consist of treaties and protocols (or amendments). The most recent one was ratified in 1949, after World War II.
Protected persons are entitled, in all circumstances, to respect for their persons, their honour, their family rights, their religious convictions and practices, and their manners and customs. They shall at all times be humanely treated, and shall be protected especially against all acts of violence or threats thereof and against insults and public curiosity. Women shall be especially protected against any attack on their honour, in particular against rape, enforced prostitution, or any form of indecent assault. Without prejudice to the provisions relating to their state of health, age and sex, all protected persons shall be treated with the same consideration by the Party to the conflict in whose power they are, without any adverse distinction based, in particular, on race, religion or political opinion. However, the Parties to the conflict may take such measures of control and security in regard to protected persons as may be necessary as a result of the war.
This treaty was signed by 194 countries.
The Geneva Conventions apply to countries who have agreed its terms. However, there are issues with regard to your second question as to whether the conventinos work or not. When the Geneva Conventions apply, countries must give up part of their national sovereignty to comply with international law. These laws may not be in accordance with their own country's consitution, values or other laws. Many critics argue that the Conventions offer many rights to individuals but not to governments and governments are therefore hesitant to accept the Convention's responsibilities.
Also, there are all sorts of ways "around" the provisions of the Conventions. For example, currently the United States is involved in "armed conflicts" in the Middle East. But, are they really wars? What is the definition of "war"? In the U.S. Constitution, war has to be declared by the Congress, and all of the U.S. conflicts have not offcially been wars. Plus, what about countries that are not part of the Geneva Conventions? Just because the U.S. may respect its provisions, does not mean that other countries will. Also, has the United States complied with the provisions of the Geneva Convention at Abu Ghraib? It's debatable. Were the terrorists imprisoned there "victims of war" or "enemy combatants"? If they were "enemy combatants" then the U.S. has a right to protect itself, but if they were "victims of war" then the Geneva Conventions were supposed to apply.