The "extension" that your company applied for is an extension of the H1b petition, plus a request for H1b Extension of Stay (i.e. to extend your status).
If you leave the US while it is pending, the petition extension will continue to be processed (you don't need to be in the US to be petitioned for H1b), but the Extension of Stay application will be automatically abandoned (since you only have status while in the US, so there is no status to extend if you have left the US).
The next time you enter the US, you will be admitted to a new status based on your visa. If you enter on your H1b visa, how long you will be admitted for depends on the H1b petition that you present. If at that time, your new H1b petition has been approved and you show a copy of this approval when you enter, you should be admitted until the expiration of the new H1b petition (unless your passport expires sooner). There is no need to get a new visa, as long as you enter before or on the expiration date of the visa.
However, if the new H1b petition has not been approved, you will only be admitted until the expiration of your current H1b petition. Then, even if the new H1b petition is later approved, your status won't be extended. You would have to either leave and re-enter the US to be admitted until the expiration of the new petition, or your company would have to file another extension for you, requesting Extension of Stay again.