But let us suppose that you are asked to name the following molecule (i):
#"H"_3"CCH"_2"CH"_2"CH(CH"_3")CH"_3#
Now the molecular formula is #"C"_6"H"_14# (is it? perhaps you should check), but the LONGEST carbon chain is CLEARLY 5 carbons long.
On the other hand, for the molecule (ii), #"H"_3"CCH"_2"CH"_2"CH(CH"_2"CH"_3")CH"_3#, the longest carbon chain is 6 carbons long.
So (i) is a pentane derivative, #H_3C^(v)C^(iv)H_2C^(iii)H_2C^(ii)H(CH_3)C^(i)H_3#, and here I have superscripted the carbons to give their position on the chain. I would come up with the name #"2-methylpentane"#. Had I numbered from the other end, to give #"4-methylpentane"#, this would contravene the rule that substituent numbers be minimized, i.e. be as low as feasible.
And (ii) is a hexane derivative, #"2-methylhexane"#, because clearly I could rewrite it to give the equivalent structure, #H_3C^(vi)-C^(v)H_2C^(iv)H_2C^(iii)H(CH_3)C^(ii)H_2C^(i)H_3#, but here it is correctly named.
Anyway, at the moment I do not know what level you are learning. There is a lot of expertise available on these boards, so if there is a more specific question fire away.