The pH of a solution is determined by the number of H+ and OH- ions present per unit volume. If you know the concentration of the ions, the math is not too difficult; pH= -log [H+] where [H+] is the moles of H+ ions per liter of solution. As nessus says, a pH below 7 is an acid (has more H+ than OH-), a pH above 7 is a base (has more OH- than H+) , and a pH of exactly 7 is neutral. A neutral solution has equal numbers of H+ and OH- ions.
It's important to note that not all solutions have a pH. If it does not have any H+ and/or OH- ions in it, there is no pH by definition. For example, alcohol and oil based solutions may not have a pH.
Acid solutions have a pH value below 7 and down to 0. Basic solutions have pH greater than 7 and up to 14. Neutral solutions, by definition, all have a pH value of 7. pH ranges then from 0 to 14 with neutral in the middle (although under special circumstances this range can be slightly increased).
You can buy soil pH testing kits from hardware and garden stores. The chemical usually used is called universal indicator. The pH of the substance tested (it doesn't have to be soil, you could test vinegar or soap etc.) causes a colour change in the indicator which is green for neutral initially. So a neutral test substance will cause no change from green. Any other colour change can be compared to a colour chart supplied with the kit from which you can read off the pH of the test substance.