It’s more important to be careful in coming up with the right abstractions and algorithms and to write clean clear code, but if possible use these rules:
* Methods should not have more than 30 code lines. * A class should not have more than than 30 methods.
More info here.