In the field line picture, $\vec\nabla\cdot \vec B=0$ means that the lines don't end (because at the point where they end the divergence would be nonzero). (This is slightly heuristic, but generally correct.)
In the case of the magnetic field, this statement holds everywhere, so magnetic field lines end nowhere. Closed lines are thus the natural choice. For
(Note that teh situation can be more complicated, see e.g. Must magnetic field lines close upon themselves or go to infinity?)
For the electric field, $\vec\nabla\cdot \vec E=0$ only holds in limited charge-free areas, hence the lines can simply enter the area and leave again, without closing onto themselves. (They could of course, subject to Maxwell's other equations, i.e. changing magnetic field, as Richard's answer indicates.)
Note, however, that even magnetic lines don't have to be closed when you take the hint: A constant uniform field $\vec B=(0,0,b)$ corresponds to evenly spaced straight infinite field lines and satisfies Maxwell's equations just fine.