It is generally held that "We" in the Qur'an is the "royal we", to express Allah's grandeur and status, similar to how kings refer to themselves as "We" rather than "I" in proclamations.
"We" is usually used in the Qur'an in verses which emphasise Allah's rule and command whereas "I" is used in verses which express Allah's nearness or care, and a direct relationship - for instance, "call upon me and I shall respond to you".
Sometimes "We" seems to shift to "I", or vice versa, for rhetorical effect. (That is, to make the power of the language stronger.)