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.
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.
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.
Desperdiciar is to "trash" something, that is to destroy it. That would be a "waste."
Malgastar is to use, or "spend" something badly. You're not making optimal use of it. But that's not quite as bad as actively "trashing" something.