The molecular mass plays a part in it. More mass in an atom, the more energy is required to break those bonds. This isn’t always true, though. There are other forces at work as well. Van der Waal forces, hydrogen bonds, dipoles, etc all add another factor to consider. Metallic lattice structure plays a part, ionic bonding for compounds do as well.
To change form, you have to break or reform the bonds (depending on which way you are going with phase change). This speaks to energy…it takes energy to break the bonds. In this case it is seen as heat…kinetic energy that excites atoms. Since our periodic table doesn’t account for all molecular traits of each atom, the melting points don’t follow a set pattern throughout the table.