Dipole moment is dependent on two factors charge and bond length.
Fluorine is most electronegative element therefore the charge separation in C-F bond is very high compared to C-I bond as C and I have comparable electronegativity values. Due to higher charges on methyl fluoride it has higher dipole moment than methyl iodide.
Even though, in methyl fluoride the C-F bond length is smaller than C-I bond length. But the charge
factor is dominant over the bond length factor due to very high charge separation of C-F bond.