The number of molecules in some water isn't affected by changing its temperature. But to know if you have the same number of molecules in two water samples, you need to compare their masses, not their volumes. When you heat some cool water, it expands. (When you slightly warm some ice-cold water, it contracts a little, but let's keep this simple.) So hot water takes up more space than cold water. The amount of space something takes up is called volume. If you were to have 2 cups of water, one of hot water and one of cold water with equal volumes, the cold water would have more molecules.
Hot and cold water are made of the same type of molecules. Each molecule has one oxygen and two hydrogen atoms. The difference between them is the speed of the molecules jiggling around.