When is a crime a hate crime and when is it terrorism?

The question seems to come up almost every time a crime occurs where the perpetrator is of a different race, religion or ethnicity than the victims: Is it a hate crime? Is it an act of terror? Why are some violent acts…