Settlers of Catan cities and knights mighty knights maximum numbers
Yes, you are always limited to the number of pieces you have, no matter what that piece is.

In the case of Cities and Knights, the Fortress does only allow you to upgrade your two strong knights (level 2) to mighty knights (level 3), which in itself is only an upgrade of 2 strength. However, in doing so, it also means that you can have up to six knights on the board - 2 of each level - compared to the 4 you can build without the Fortress. And in terms of total strength, you go from a maximum of 6 to a maximum of 12, so you're actually doubling your capacity to defend against the barbarian. And that's not even looking at the options of displacing strong knights on your roads.