As has been pointed out, there is no set rule, and situations vary widely by diocese. There is no canonical requirement as to length of service for pastors or assistants; that is completely up to the discretion of the bishop. Some bishops create policies (“particular law”) and adhere to them strictly, while others do not. Some bishops continue the policies set by their predecessors, while others do not. If there is an influential priests’ senate in the diocese, some bishops consult with them for (name removed by moderator)ut on such policies, while others do not. Pastors usually stay longer than assistants, obviously, but sometimes one sees long-term assistants, as well.
The pastor of my former parish in another diocese is still there–he is in his 33rd year as pastor there. A dozen years ago I attended a conference at a parish in yet another diocese, where the pastor–a monsignor and a protonotary apostolic–was in his 42nd year as pastor of that parish. That was unusually long, but occasionally it happens when the priest is of some renown. In my current diocese, the bishop does not have term limits, and leaves pastors where they are if they do not request a transfer and all is going well. Under such circumstances, he will offer transfers every few years, but not require them.