The first one is correct. CH3(CH2)2Br = H3C-CH2-CH2-Br = 1-bromopropane
The second one cannot exist as written. 2-bromopropane would be CH3CHBrCH3 = CH3-CH-CH3 with the Br attached to CH.
CH3(CH3)2Br is missing a C to attach to the Br so it would be CH3(CH3)2CBr which would be 2-bromo-2-methylpropane or tert butyl bromide (it would look like a + with Br attached to)
Here is a quick sketch of 1-bromopropane and 2-bromopropane. The best thing to do is to draw the structures out to see for yourself.
Hope this helps.