There are many different Harry Potter works including:
- short stories
- card games
- video games
- amusement parks
- web content
Which ones are considered to be canon?
As Stu Wilson said, there's no "official corporate position" of JKR on the topic; so the exact hierarchy of canonicity is somewhat subjective and personal.
Having said that, I would like to offer what my personal preference is, together with objective explanation of why that order was chosen. (For other commonly accepted opinions, see @ibid's answer)
This is more canonical than interviews for 3 reasons:
A. Interviews are spur of the moment things where JKR may say something off the cuff. She made mistakes in interviews before. Pottermore is "official" content she spents time to think through.
B. Much of Pottermore content is much newer than a vast bulk of JKR interviews.
C. JKR officially noted in 2012 that Pottermore is currently a replacement for her originally-planned HP Encyclopedia.
Pottermore is also more canonical than books for the reasons B and C above.
Note: This only applies to Pottermore content by JKR. Pottermore content NOT known to be by JKR slides down to same level as films.
Original JKRowling.com website.
I view it as Pottermore-lite, except that it was much earlier AND wasn't billed as "official encyclopedia stand-in".
This also includes things like W.O.M.B.A.T.S. and various "gazette" type promotional materials that were at some point posted by JKR.
JKR interviews where JKR clearly announced that the book is wrong (or where there's no discrepancies with the books).
This includes things like "No, Harry wasn't a Horcrux, no matter what Dumbledore said in DH".
JKR interviews and Wonderbook content where JKR contradicted the books but didn't actually acknowledge that the book was wrong (and the book was earlier than interview)
But in case of conflict between books and interviews; I view the situation as more of "needs deeper digging" than easy and obvious "book is wrong" kind of dilemmas.
Note: Wonderbook content not 100% known to come from JKR slides down to just above the films.
HP books 1-7
Also on this level will be the Fantastic Beasts screenplay if it is proven conclusively to be 100% in JKR's control.
Supplemental JKR books (Beedle the Bard, QTTA, HP Prequel story about the bicycle, Fantastic Beasts, Daily Prophet, Wonderbook content)
I don't have a very good reason to view main HP books as more canonical than supplementary books; so I can easily agree if someone insists on switching them in the hierarchy. As we know from this excellent asnwer, there are some discrepancies so the order may mattter.
Also on this level is the Famous Wizard Cards from the EA games which have been confirmed to be written by JKR.
Harry Potter and the Cursed Child by Jack Thorne
This has been marketed as "The Eighth Story", but wasn't written by Rowling.
JKR interviews where JKR contradicted them in later books
Wonderbook content which is NOT 100% known to come from JKR
Fantastic Beasts Film where not proven to be from JKR screenplay
Higher up than the other movies as JKR exercised greater creative control.
HP Movies 1-8
Personally, I don't really consider movies canon almost at all. BUT, they are marginally canonical in a sense that JKR did approve a lot of things in the movies and had feedback into them. Some people consider them to be almost as canonical as books. I consider them significantly LESS canonical.
CAVEAT: The only case where a movie is full canon is when it's a details that's KNOWN to be approved by JKR explicitly.
Facts sourced from Harry Potter amusement parks and Video Games
This is even less canon than movies but probably a shade above fanfics if there's a reasonable suspicion JKR approved of a specific fact.
Assorted fan fiction
This is NOT canon at all as JKR didn't approve any of it.
Officially, there is no official position; however I would list the following as canon in this order:
The movies I would not consider canon at all, even though they do follow the books closely, there are enough inconsistencies to merit removing them from canon.
Neither J.K. Rowling nor Warner Bros has made any official policy over what constitutes Harry Potter canon. (but see the end of this post)
There are differing opinions among fans.
Here are the canon policies of two of the most popular Harry Potter fansites, along with some other popular opinions: (Note: A detailed list of all of Rowling's Harry Potter writings can be found here.)
Information which has come directly from JKR in either written or spoken form is considered canon. All other sources, including the film version from Warner Bros., are NOT considered official or canon
Tertiary Canon (considered to be canon where they don’t conflict with the above sources)
Basically put, everything is canon unless specifically contradicted by a "higher" source.
Only the seven books themselves are canon
(This is a very popular opinion, but I don't know any websites that have adopted it.)
If Rowling said it’s canon, then it’s canon.
Many people have pointed to JK Rowling's tweet where she says that The Cursed Child should be considered canon. Therefore, we now have a new canon policy:
At this point, I would say only the books should be considered canon.
For me, any "revelation" that JKR has made since the publication of each individual book has been irrelevant or inconsistent with the characters, and the movies made a lot of terrible mistakes. (For example, at the end of the second film, after Dobby is freed, Lucius Malfoy begins to say "avada-" and is then blasted by Dobby. It's safe to assume the next word would have been "kedavra", which is not consistent with Lucius's character, or the setting - outside of Dumbledore's office, broad daylight - .)
Additionally, JKR was a bit sloppy and didn't recheck the books for plot holes, and then made up silly excuses in interviews to cover them up (Fred and George not noticing Pettigrew!) . She has also been inconsistent with her answers (For example, when asked about the number of students at Hogwarts, her answers are all over the place.)
All in all, I personally believe after a book is published the author can't change it. If any of the sources other people mentioned here either expand the universe or clarify the books, then they are probably fine. If they attempt to change what was written, or contradict the original text, they are not canon.
Miscellaneous information from J. K. Rowling
The movies are not considered canon as on several points they conflict with the books.
I left a couple of rather grumpy comments on the question suggesting that "canon" is whatever you want it to be. Even if a company, or even the author assert that a given list of works constitutes canon, there is no need to go along with it.
I suppose I should say what I want it to be, although I doubt that my opinion will be popular.
Harry Potter is primarily a series of books, and so I consider the books themselves to be canon. I don't consider derivative works, such as the films, games, etc. to be canon even if the author had some part in developing of approving them.
I will consider commentary or minor works by the author as canon provided it can believably be said to represent what the author meant at the time of writing the main books (it is possible that JKR has gone beyond this).
It isn't that I'm biased towards books. I take a similar position on franchises (such as Star Wars) that are primarily films. In that case, I would consider the films to be canon, and not derivative works, such as novelisations.