M-x auto-fill-mode. The default maximum line width is 74, determined by the variable fill-column. To find how to turn this on automatically see section How do I turn on Auto-Fill mode by default?.