What is a "diploma mill"?
We should start with the Wikipedia definition:


  A diploma mill (also known as a degree mill) is an unaccredited higher education institution that offers bogus academic degrees and diplomas for a fee. These degrees may claim to give credit for relevant life experience, but should not be confused with legitimate prior learning assessment programs.


If a student doesn't have to do any academic work for a degree, or the student is given credit based on "life experience," it qualifies as a diploma mill.  Another key indicator is whether there are actually any teachers that work for the business.  While it is probably not illegal in most cases to claim a degree from such a company (and I deliberately do not use the term "institution"), there have been many cases of employees being disciplined or fired for using the degree to either get a job or to obtain a higher salary based on claiming a degree from a diploma mill (esp. teachers whose salaries are based on the level of a degree).

As the Wikipedia article notes, there are legitimate schools that have a system for awarding credit based on other formal education, such as military education obtained while on active duty or in the reserves (see, for instance, this guide to transferring credit).  This type of credit transfer is rare for graduate work, although certain rigorous post-baccalaureate programs in the military, such as the U.S. Navy's Nuclear Power School, may qualify for some post-B.S. programs.  This type of credit should not be confused with work obtained at the military's post-graduate schools, such as the Naval Postgraduate School or the Air Force Institute of Technology.

Diploma mills should also not be confused with for-profit education, such as the infamous University of Phoenix.  Arguments over the merits of for-profit education are not really within the scope of academia.stackexchange, but for what it's worth, degree-granting institutions of this type do require students to follow a curriculum, take actual classes (many times online), and give grades based on assessed performance (and charge a good bit of money per credit-hour).

Bottom line: if you have to pay a nominal fee for a "degree" that requires no official classes or research, you got your degree from a diploma mill.