In order for a substance to melt, it must absorb enough energy to overcome the intermolecular bonds holding its molecules together. These bonds may be ionic, molecular, covalent or metallic, depending on the material involved. Ionic bonds require the most energy to overcome, while molecular bonds are easier to break.
Ionic bonds occur when two ions are attracted to one another due to their opposing electrical charges. Salt is an example of an ionic solid, composed of positively-charged sodium atoms and negatively-charged chlorine atoms. It takes a considerable amount of heat to overcome these type of bonds, so ionic solids have high melting points. Covalent bonds, such as those that hold together the carbon atoms in a diamond, are also very hard to break.
Metallic solids are held together by their free-floating electrons. Metallic atoms can easily gain and lose their outermost electrons, which is why they transmit electricity so well. The strength of this type of bond varies with the individual metal atoms, which is why the melting points of metallic solids can vary so significantly. Tin has a relatively low melting point, while it takes considerably more heat to break the metallic bonds in iron.
Molecular bonds are those that hold together non-metallic molecules, such as sugar. These are relatively easy to break, either through chemical action or the addition of heat. Therefore, molecular solids usually have a low melting point.