The word ‘cannot’ is actually one word. On rare occasions ‘can not’ should only be used as (two separate words)
Most people tend to use the words can not incorrectly, i.e. I can not attend the meeting, instead of the correct grammatical usage which is – I cannot go the the meeting.
Personally- I feel that the only time that it should be used out of context is when you are refering to situations in which you want to put particular emphasis on negative content, for example – really stressing the word not: ‘You can NOT do that to me’! which sounds far more convincing than ‘ You cannot do that to me’. Even if you wrote ‘CANNOT’ all in capitals, it still doesn’t seem to stress your annoyance as effectively.
Generally though – The best rule of thumb to follow would be to use the word ‘cannot’ and not treat it as two words unless you feel it is really necessary.
Particularly if you are writing professionally, either at work or in education.