You reject the null hypothesis if the test statistic is inside either tail.
With a level of significance of 5% a two-tailed test means that the integration of each tail will be equal to 0.025, so the 2.021 is the y such that:
Integral (0 to y) of t-student(n-2)(x) dx = 0.975
Since the t-student is symmetric the other tail goes from -infinity to -2.021. And our value is out of there.
A similar reasoning is applied to a one-tailed test.