As the title says : What is the maximum length of a string that can be stored inside a custom dimension in google analytics?
So the maximum length of Custom Dimension value must not exceed 150 bytes.
There are various tools to calculate the bytes out of Characters. One of it I found: https://mothereff.in/byte-counter
Reference: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#dimension