Algebraically, a given transformer model can operate on sequences of unlimited length. (See the implementations of self-attention and multi-head attention.) However, there is both a theoretical and a physical limit to sequence length (setting aside physical storage limitations, which are not really the limiting factor for this algorthm.)
Physical limitation: time complexity. Self-attention is a weighted average of feature vectors. This must be computed using an all-by-all matrix of weights, which implies a comparison of each position to each other position. In other words, self-attention (at least when computed exactly) has a time complexity of
Theoretical limitation: entropy. See Entropy of self-attention as a function of sequence length.