When a program is compiled in "ANY CPU" it means that it is architecture neutral - It can be run in both 64bit process or a 32bit process. It is determined by the platform that the program is being executed on. If it is a 64bit platform, a program built in ANY CPU will load as a 64 bit process. On the other hand if it is a 32 bit platform, a program built in ANY CPU will load in a 32 bit process.
However, you cannot build everything as "ANY CPU" because you may have dependencies that requires one platform or the other
A program must be built with x64 mode if it has x64 dependencies (relying on other libraries that are built in x64). This also requires the program to be executed on a 64 bit platform
A program must be built with x86 mode if it has unmanaged 32 bit dependencies or if it has managed libraries that are buit in x86.
A program program has neither x64 bit dependency or unmanaged 32 bit dependencies can be built in "any cpu".
However, regardless of these rules, if you build in ANY CPU you should test thoroughly on both a 64 bit platform and a 32 bit platform. This post discusses other possible issues in more detail.
More on ANY CPU