Both names are for same compound.
Let's draw structure for 3-methyl-2-hexanone.
In name the last words i.e. hexanone means that the parent chain is made up of six carbons (hexa = 6) and the word -one means ketone. So, this is a six carbon chain containing carbonyl group. The position of carbonyl group is at position 2 (2-hexanone).
Then comes the substituents, the number at the start of the name specifies the position of substiuent (i.e. 3, at position 3) and the substituent attached at position 3 is methyl.
The structure is as follow,