Authors should have made a non-trivial contribution to the content of the paper.
Just being someone’s instructor is not a reason for inclusion. Providing data needs acknowledgement, but you are not an author unless you did something with it. Giving trivial advice, e.g. pointing out spelling mistakes, does not qualify for inclusion.
You are an author if you wrote all or part of the paper, unless you are just being dictated it. Also, if you contributed substantial ideas, e.g. suggested the experimental methodology and its application. Alternatively, you may have played a significant part in the research that the paper is about, e.g. did the experiments.