After relating the mitzvah of allowing the land to rest every seven years during Shemittah, the Torah adds an additional requirement to count a series of seven cycles of Shemittah, as well as the years within each cycle, at which point work working the land is once again forbidden during the fiftieth year, which is known as Yovel [the Jubilee year]. Although we certainly must keep track of the years and cycles to know when to allow the ground to lie fallow, why does the Torah mandate an actual mitzvah of counting the years and cycles?
In Pirkei Avos (1:15) Shammai teaches that one should make his Torah study fixed. In his commentary on this Mishnah, Rav Ovadiah Bartenura explains that a person's primary occupation throughout the day should be studying the Torah, and whenever he grows weary and needs a break, he may engage in mundane work. He should not adopt the opposite approach of spending the bulk of his waking hours involved in his job and studying Torah only when he has a bit of free time.
While it would certainly be ideal if everybody could devote the bulk of the day to Torah study, the Sefas Emes acknowledges that this is not always realistic. He therefore suggests an alternative explanation for the obligation to make one's Torah's study fixed, suggesting that the factor that determines what is considered the primary focus of a person's day is not the number of hours in which he is occupied in an activity, but what he mentally prioritizes and looks forward to as the most important part of his day. If he works long hours to provide for his family but is constantly gazing at the clock to see how many hours remain until the shiur that he attends, he has made Torah study the primary activity of his day. By the same token, somebody who is enrolled in a yeshiva but regularly checks his watch to see how much time is left until the end of the learning period or how many weeks remain until the end of the zeman is demonstrating that even though he spends countless hours in the beis hamedrash, the activities to which he most looks forward are mundane in nature.
In light of this explanation, the Sefas Emes explains that farming is an extremely labor-intensive profession. The amount of time and physical energy that a farmer must devote to his field in pursuit of a successful harvest is tremendous. To help him keep his priorities straight, the Torah commands the Sanhedrin to count the Shemittah cycles and years as a means of reminding the farmers to focus on looking forward to the Shemittah and Yovel years, during which they will be required to put their farm equipment away and spend an entire year engaged in uninterrupted Torah study. (R’ Ozer Alport)