The frequency with which you wash your jeans directly affects the amount of indigo or the color that leaches out of them, and how much they lose their shape over time. The rule is to wear them often and wash sparingly.
If using a machine, wash on cold or lukewarm if dirty, with a quality detergent.
You can also wash your jeans int the tub, leave them to soak, inside-out in cold water for about 30-45 minutes.
Tumble dry your jeans only if you want to shrink them. Instead, hang them out to air dry in the sun.