Are there different types of dental fillings? If yes, what are they. Is one kind better/longer-lasting than others?

Composite or amalgam. An amalgam is an alloy of mercury with various powdered metals. It is inexpensive & when properly placed has been known to last for many years- reliably. In my office, i only use composite resin. Which is a polymer plastic and silicates- light cured to achieve a hardness necessary for proper chewing. Not as hard as amalgam, but very esthetic because of the shade selection for color matching!
Yes . Gold is generally the longest lasting as it has properties most similar to your teeth. Because of the appearance and cost it is done less often. Most studies show amalgam restorations lasting the longest but in many instances a well done composite filling will match the longevity. Another filling material that is not used as often in the U.S. Is glass ionomer.