@Ale***
, then as other posters said when you get your new passport you take the old one and the new one (and the letter that your consulate gives you when you get a new passport overseas) to the immigration office. You go to the section where you got your extension of stay and they will transfer your stamps to the new passport.
As a rule it is 100% free to get this done BUT some immigration offices charge you. If they try to charge you ask for a receipt