You also can extend beyond the 6th year based on an approved I-140 so actually the GC process can be started in the final year but this is riskier of course. Our generally practice is to kick it off at the beginning of the 5th year but I also feel strongly that it's almost never worth it to stay in a job for immigration reasons and that if you're inclined toi switch, switch soon and negotiate with your new employer to sponsor you relatively soon (after you've proven yourself).