Hello,
We can change the length of our ids at any time and have done this regularly over the years. Our documentation page on backwards compatible changes here [1] says:
You can safely assume object IDs we generate will never exceed 255 characters, but you should be able to handle IDs of up to that length.
Now, it's important to note that this applies to API resource ids like a Customer id `cus_123` or a PaymentIntent id `pi_123`. It does not apply to other properties that would have their own individual limit, if any, like a Charge's description. For a `client_secret` for example, since it contains the id of a PaymentIntent, it could technically be longer than 255 characters, if the PaymentIntent id was that length. We don't have a specific maximum at the moment so it uses our global default of 5000 which you found!
I hope this helps!
Best,
Remi