Both cannot and can not are acceptable spellings, but the first is much more usual. You would use can not when the 'not' forms part of another construction such as 'not only'
These two spellings are largely interchangeable, but by far the most common is “cannot” and you should probably use it except when you want to be emphatic: “No, you can not wash the dog in the Maytag.”
From cannot vs. can not | the alexfiles
So this is the rule: if you either could or could not do something, then you use two words, because you can leave out the second word if you so choose. If you could not do something no matter how much you desired or tried, then you use one word, cannot. There is no other option.
Sometimes both are true. Witness:
I cannot change the world.
[I want to change the world's problems but they are too big for any one person, or group of people, to take on]
I can not change the world.
[I choose not to take on the world's problems]
From LISTSERV 14.4 :
One point worth making is that despite the standard gloss of "cannot" as "can not" in a number of dictionaries, the two expressions are not interchangeable. "Cannot", like "can't", is a lexical item, and as such it has a partially opaque meaning. In this case, "can not" can be used when the modal takes wide scope with respect to the negation, while "cannot"/"can't" are always understood with wide-scope negation (not-possible/permitted):
An Episcopalian priest can not marry (if he doesn't want to).
A Catholic priest cannot marry (whether he wants to or not).