Both of these words are used for complicated and problematic situations, but there is a small difference between them.
A quandary is when you don’t know what to do; you are in a state of uncertainty. A dilemma is a situation where you have to choose between options that all seem bad in some way.
Basically, a quandary is more general. In a quandary, you might not know or be able to identify the specific choices available… and although the situation is difficult, there might still be a good way to resolve it. The issue of illegal immigration in the United States is a quandary, because there are many different factors that make it problematic, and a solution is not clear.
In a dilemma, you can understand the specific choices, but all of the alternatives have some disadvantage. If you are in a great romantic relationship, and suddenly you get offered your dream job in another city far away, then you are in a dilemma because whichever choice you make will be bad in some way (bad for either your career or relationship).