So, a machine language can be worked directly by a hardware ( processors , etc ) without further translation or compilation.
But, machine language differs for different hardware ( AMD processor, Intel processor ). Different hardware requires slightly different method to program using its machine language.
C++ or other High-Level languages require a Compiler to translate the scripts into a computer understandable code ( Machine Language ).
This is correct. "Machine code" is the data used directly by the processor. Assembly Language is a symbolic representation of this machine code- you didn't mention Assembly, but I think it's worth mentioning. Assembly is the closest a person should get to machine code unless they have no choice.
Since machine language differs for different hardware, does this means I can't compile a program that can run on every computer?
You are correct. a program compiled for an x86 CPU will not run on a ARM; a program compiled for a ARM will not run on an x86, etc. However there is a case that may be worth mentioning- some languages are compiled not to machine code, but rather to an Intermediate language or bytecode, and that intermediate language or bytecode get's run by a "Virtual Machine", rather than being run directly by the hardware.
Or maybe I need to recompile the program on other computers just to make sure they can run?
Essentially, yes. Excepting when you are compiling to a intermediate language as described above (Java or .NET, for example).
Does C++ and other High-Level languages specially engineered such that it could compile a written program into many other kinds of machine language and how does it make the right choice?
When you run a C++ Compiler, it compiles for the architecture it is running on or a compatible architecture, typically. At any rate compilers need to be written specifically for every single architecture that is intended to be compiled to. This is why C is so ubiquitous across different platforms- it is a fairly simple language and it's control structures and capabilities are easier to create compilers for.
What kind of file extension is used for the machine language? Is it .exe? Or is it different for different Operating System?
machine language doesn't have a file extension. It can be present in any number of files. an .exe for example could include machine code, or it could include bytecode, or P-Code, or any number of things.
Since a machine language is used for targeted hardware only, why would a machine language extension being effected by Operating System?
I'm not sure what you are referring to, but the best I can guess is perhaps referring to how you cannot run 64-bit programs when you are running a 32-bit OS?
A modern x86 processor is, in some ways, really several processors in one. the latest i7 is fully software compatible with the original IBM PC 8088 instruction set- you can boot from a DOS floppy just like you did in 1983. Effectively what Intel (and AMD) do is add new enhancements into new operating modes. As an example, 32-bit Protected mode is the mode of operation required to run 32-bit programs. So when you run a 32-bit OS, Windows switches the CPU into 32-bit protected mode, allowing it to run 32-bit code as well as utilize the features of the 32-bit Processor.
running 64-bit code requires that the CPU be in what is referred to as "64-bit Long mode" but may as well just be called 64-bit protected mode. It's basically the same idea as 32-bit protected mode, with enhancements and new features added to the new mode to prevent introducing possible compatibility problems with old software.
It should be obvious now why running a 32-bit OS on a 64-bit platform prevents 64-bit programs from being run. It is because in that case even though the hardware is 64-bit, because it is running a 32-bit operating system and that 32-bit operating system switches to 32-bit protected mode and assumes and uses the system as if it is in fact just 32-bit, no 64-bit code can be run.