How important are these parts for a gaming computer?

Since I don't have a whole lot of money right now, I'm buying new parts for my PC bit by bit. My PC is pretty decent for now considering what I play (diablo 3, wow, lol, minecraft). The problem being, it lags sometimes. Even on minecraft. It's not all the time, just in certain places and on occasion, just randomly. I.E. On minecraft, it begins to lag when I enter the nether, it's also lagged a bit but then gone back to normal a few times when on multiplayer. On diablo it lags when I enter the Nephalem Rifts in Adventure Mode when online.

The other games play really well, with a 45fps average on LoL.

So anyway, what are the most important parts in a list? Also, if you can tell from this, what am I most likely to benefit from mostly?

Processor, Graphics Card, Memory.

If you have less than or equal to 4gb RAM (Memory), then I'd upgrade that first to anything higher (8gb, 12gb, 16gb+). Personally, I have 8gb and I think its more than enough for gaming, unless you plan on doing highly intensive video editing/processing or image manipulation etc. The processor is great if you 'can' upgrade it, but they are usually very expensive. I suggest any Intel i5 range, or at least an i3 if you can afford it. Graphics cards are also quite expensive, but if you use Nvidia Geforce varieties, anything from the GTX 650 onwards would be able to handle most newer games adequately, with the later ones 660, 670, 680+ running games on high and ultra settings. In order of preference, I'd upgrade the RAM first, then the GPU, then the CPU. Also, consider investing in an ssd (solid state drive) for your games, as they drastically reduce load times. They too are quite expensive, but even a 60gb one can hold a few games and are usually a little over $1 per gb.