Bold Letters Disclaimer: Stack is not a source for legal advice. The copyright lawyers can and will do whatever they fancy.
Derivative works must meet the criteria for fair use (References: stanford.edu - nolo.com) or you could face a lawsuit.
The four factors judges consider are:
- the purpose and character of your use
- the nature of the copyrighted work
- the amount and substantiality of the portion taken, and
- the effect of the use upon the potential market.
There is a HUGE no-no: do not attempt to make money off a derivative work unless you have legal backing (i.e. hire a lawyer). This might mitigate the chances you get sued.
Let's assume then you are creating your campaign for your own group's entertainment, or that you are going to make it available for free in the internet.
Nature is almost aways moot. You are creating a derivative work of a copyrighted franchise. This one mostly fails. Also there are licensing issues. We are assuming you are not using a work with a copyleft licence (Creative Commons, GNU documentation, OGL, and so on).
The amount. You should not be using large portions of the original work. Some references are ok, but it cannot for example contain the whole script of the movie. And most of the time, you should be using your own words to describe the settings instead of just copy-paste from the book or script. Think parody instead of plagiarism. Using images and screenshots of the works for mere illustration is also not good. See wikipedia on fair use and their policy.
Economic impact. Would your product compete with an official campaign setting? Would people rather use your product than buying the official one? Would you make Ed Greenwood starve by releasing a FR atlas? This is subjective, but works both ways, and their lawyers are pretty damn good at
lying proving their point in this matter.
So you should strive to meet criteria 1, 3, and 4, and probably nobody will send you a cease and desist letter.
As it clearly states on the first line, the copyright laywers can and might do sue you. What you can do is to make a case where you can claim fair use if you are ever brought to a court. The main issue as KRyan said, is if they are losing money (or even just losing a possible opportunity to make money).
There is no legal requirement or standard to meet before sending a C&D. They can send one on any grounds they like. You will only ever be tested on these conditions if you go to court and argue it in front of a judge—a very expensive proposition. (On the other hand, complying with a C&D letter, taking the material down, will probably be sufficient to get most copyright-holders off your case for something like this, limiting the amount of danger in this.) Also, whether or not you made money is really largely irrelevant—it’s whether they lost money. – KRyan