You can't copyright ideas or game mechanics. That much should be obvious from the number of "clone" games around. So you can make a game that exactly followed Quidditch rules without much worry.
Use of copyrighted material (whole chunks of Harry Potter's text explaining the rules of Quidditch, for example) is generally not possible without the copyright owner's permission.
Use of small snippets of copyrighted material (the name "Quidditch", for example) is a grey area. Possibly it would be OK because of "fair use" exceptions, but it would depend on jurisdictions and how willing either side is to file/defend a lawsuit. Also Quidditch might be trademarked - which is separate from copyright and would bring in a whole new set of legal complexity. You should probably consult a lawyer if you plan on entering this territory.