Test statistic is used in significance testing, based on which the p-value is calculated. It measures how far the observed sample is away from the null hypothesis. When it is far, we tend to reject the null hypothesis.
Note the computation of p-value for many significance tests requires first calculating the test statistic. Since statistical software nowadays can provide a p-value in many applications, it is often more convenient to draw conclusions based on a p-value rather than a test statistic. Having said that, some journals do require reporting test statistic in addition to p-value, and it is always good to have an exercise on how a test statistic can be worked out, at least once lifetime.