I think length restrictions can be informed by the behaviours the site wants to encourage and/or discourage. A large character limit can encourage users to engage in discussion or to write detailed and well researched posts. While, a small character limit would set an expectation for directness and brevity in posts.
This can work well in the aggregate, but is not fool proof. StackExchange wants to ensure that comments are not used to post answers. But the 600 character restriction cannot prevent contributors from writing short answers as comments. Sometimes the limitation is just technological. Twitter's 140 character limit is a holdover from its origin as an SMS service (SMS has a 165 character limit).
I think the frustration of hitting the limit is a reminder to the user that their current expectations don't align with the sanctioned behaviours for the site. If the limitation is unusual then the site probably needs to have an explanation near at hand. Again, StackExchange does a good job of this the placeholder text for comments tells the user what should and shouldn't be there.