Maybe very trivial question but I don't know the answer. When I create a new field , I always think why don't I give the max length for this field? How does 20 is different from giving 100 as length. Is there any performance difference in the database for this.
For normal objects, there's no difference in performance. For Custom Settings and Custom Metadata, allocating too much space will affect the number of settings/metadata records you can create, but otherwise don't affect performance. Note that Long Text Area (LTA) fields share a per-object character limit, too, so creating fields longer than necessary will limit how many LTA fields you can create.