Effective October 17, 2000, The American Competitiveness in the Twenty-First Century Act(AC21), permits H-1B non-immigrants to obtain an extension of H-1B status beyond 6-year maximum period, when:
the H-1B non-immigrant is the beneficiary of an employment based (EB) immigrant petition (I-140) or an application for Adjustment of Status ; and
365 days or more have passed since the filing of a labor certification application, Form ETA -750, that is required for the alien to get employment based greencard, or 365 days or more have passed since the filing of the EB immigrant petition(I-140).
H-1B non-immigrant in above mentioned scenario can get extensions of H-1B non-immigrant visa status in increments of 1 year at a time, until a final decision is made on the H-1B non-immigrant's greencard.
According to the law passed on November 2, 2002; "21st Century Department of Justice Appropriations Authorization Act" (H.R. 2215), H-1B non-immigrant can extend H-1B 1 year at a time, even if his labor in not approved but pending for 1 year or more. It is not necessary that it should be approved.
Note that the adjustment application, labor certification, or visa petition need not necessarily have been pending for a year to obtain this benefit. The only requirement is that 365 days have passed since filing of the labor certification or immigrant visa petition.
An alien employee substituting the original alien beneficiary of the "approved" alien labor certification application can file his/her 7th-year H-1B extension as long as 365 days have passed since the filing of the labor certification for the original substituted employee and the labor certification application has not been denied or revoked. Additionally, in order to prove that the employer decided to substitute the employees, before the substituting employee can apply for 7th year H-1B extension, the employer should have filed I-140 petition for him/her using the certified labor certification application. In all these cases, the alien should maintain a valid H-1B status without violation.
Source:
http://www.immihelp.com/visas/h1b/beyond6.html