There are many different Harry Potter works including:
- short stories
- card games
- video games
- amusement parks
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)
High level, my hierarchy is:
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.
There are differing opinions among fans.
Here are the canon policies of two of the most popular Harry Potter fansites: (Note: A detailed list of all of Rowling's Harry Potter writings can be found here.)
Miscellaneous information from J. K. Rowling
The movies are not considered canon as on several points they conflict with the books.
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.
Some which I can think of are: