While all three candidates are pretty clear on their overall view of Iraq, they each have subtleties in their positions which are not as well known (all quotes are from the candidates' websites linked to their names below):
Hillary's position is clear: Get the troops out of Iraq. However, her position relies on a diplomatic initiative which will require the support of the U.N. and cooperation from "key allies, other global powers, and all of the states bordering Iraq."
Obama's position is similar to Hillary's, with one key exception:
He will keep some troops in Iraq to protect our embassy and diplomats; if al Qaeda attempts to build a base within Iraq, he will keep troops in Iraq or elsewhere in the region to carry out targeted strikes on al Qaeda.
Based on that loophole, Obama could conceivably keep troops in Iraq for the entirety of his presidency.
Everyone knows about McCain's "100 years" comment about Iraq. His position supports that view, as he plans to INCREASE the number of troops we have in Iraq:
More troops are necessary to clear and hold insurgent strongholds; to provide security for rebuilding local institutions and economies; to halt sectarian violence in Baghdad and disarm Sunni and Shia militias; to dismantle al Qaeda; to train the Iraqi Army; and to embed American personnel in Iraqi police units. Accomplishing each of these goals will require more troops and is a crucial prerequisite for needed economic and political development in the country. America's ultimate strategy is to give Iraqis the capabilities to govern and secure their own country.
If Iraq is your primary issue going into the election, the choices are pretty clear. McCain wants to fix Iraq, Clinton wants us out of Iraq, while Obama wants us out but is willing to consider staying there if circumstances require it.