This depends on the context and also on the person you are asking. There are some disciplines in which "error" is a technical term. In addition, there are some scholars who use the words in distinct ways.
For the general public, these words are interchangeable. The only real difference is that "error" is a much more formal-sounding word than "mistake."
There are some who would argue that an error is when you get the wrong answer because you had no idea about the subject. By contrast, a mistake is when you give the wrong answer by accident even though you knew the right answer. A mistake, then, would be if I typed "misteak" whereas an error would be if I didn't know the difference between "mistake" and "mystique" and confused them in my answer.
There are also fields in which "error" has a technical meaning. The best example of this is in statistics where there is "error" in any sample, regardless of whether someone has done something wrong.
Overall, then, there is no difference between these two words that everyone would agree on other than the fact that error is used less frequently in casual situations.