You can apply for an 8th year extension if an appeal is filed on the denied perm. Otherwise your I-140 needs to be approved as the new perm was not applies 12 months before your expiry of the H-1. You can apply for change of status anytime before the expiry of your H-1.