I learned that "waste" in English can be translated as desperdiciar or malgastar in Spanish. What is the difference between these two words? Are there any cases where one is correct and the other is wrong? Which is the more general-purpose word for "to waste something"? Are there any other common translations besides those two verbs?
In addition to Laura's answer there are some subtilities I'd like to add. Mostly the difference resides on usage.
Gastar comes from spending, spending money, spending time, and so on. So malgastar really means misspending. Means that you are not spending whatever it is you spend in a effective way. As she said, malgastar is rather not used with ocasión, momento, etc... But it is mostly used with money and time for instance.
To be more precise, malgastar is rather used when you use the money for something that you don't need and sometimes you are not even interested in.
Tito es un bobo, malgastó sus ahorros en una máquina de granizados.
Andrés malgasta mucho su tiempo jugando runescape.
Now, desperdiciar is a little bit more general and sometimes considered as a synonym with desaprovechar, you can use desperdiciar for money, time, food, virtually anything you can think of.
Manuel se sirvió 8 platos en el buffet de ayer pero sólo se comió la mitad de uno... ¡Qué desperdicio!
Carlos estuvo bañándose por una hora y media. ¡Qué desperdicio de agua!
For desperdiciar to be understood as a synonym of desaprovechar the thing that is wasted must be something that you can get or use more effectively. It can be an opportunity or time itself. Desaprovechar literally means "to not take advantage", to not take advantage of an opportunity or time.
I hope this helps to further explain the differences, and additionally those with desaprovechar.