Hi, the first compound is 2,2,4,4-tetramethylpentane. It helps to draw out the structure first, so you can find the longest carbon chain and go from there.
The second name I think is acceptable, although we can "tidy it up" a bit by numbering in the other direction to get 2-chloro-3-methylbutane. This way, the numbers are in order from lowest to highest. This is normally done when for instance there are only two groups present and you get the same numbers for their positions whichever end you start numbering from. The groups are of course always required to be in alphabetical order in the name. Here's another example: 1-chloro-2-methylcyclohexane vs. 2-chloro-1-methylcyclohexane. The first name is better. Most of the time, the numbers come out in any order in a name, depending on the alphabetization of the groups or the presence of other functional groups, such as an alkene group that has a priority over groups like methyl or chloro when you number the carbons in the main chain (when a C=C double bond is part of the main carbon chain, we start numbering the carbons from the end closest to the double bond, rather than from the end closest to a group such as methyl).
Steve