Prescriptively, "can not" is wrong and must always be spelt "cannot". I use "can't" in all situations, both informal and formal, both spoken and written, unless I want to emphasise "not". Only then do I use "cannot".
It's actually more common just to say "can't" (at least in America) because it's shorter and we're lazy. "Cannot" is when you want to sound fancy or emphasizing the impossibility of what it is you cannot do.