Boiling points of Butan-2-ol and Butan-1-ol
You have certainly understood the main idea.

In general the boiling point of a substance is determined by the way the molecules come together. The closer they are, the bigger are the intermolecular forces making it harder for one molecule to leave the entire group.

In this particular case the molecules are similar, since both substances have a hydroxyl group, thus being to able to create H-bonds. But in the case of 1-butanol, the molecule is linear while 2-butanol is not. This stereochemical difference affects the way the molecules attract each other. The linear molecules are able to come closer, thus creating stronger bonds or in other words raising the boiling point, because a higher amount of energy has to be applied in order for one molecule to obtain enough, to leave the liquid phase.