Difference between chemical potential and gibbs free energy
I know that the chemical potential is the molar Gibbs free energy and that it is an intensive variable and that the gibbs free energy is extensive.


The chemical potential is related to the Gibbs energy in one of its definitions:

$$\mu_i = \left(\frac{dG}{dn_i}\right)_{T,P,N_{j\neq i}}$$

So it is the change in Gibbs energy when one component changes amount while the other components are of constant amount. The dimensions are energy per amount of substance (with units of e.g. J/mol).

The term "Gibbs energy" is used for a lot of things, and the dimensions could be energy, or energy per amount of substance. The Gibbs energy of reaction $\Delta_r G$, arguably the most important Gibbs energy for a chemist, is defined as:

$$\Delta_r G = \left(\frac{dG}{d\xi}\right)_{T,P}$$

where $\xi$ is the extent of reaction with dimensions amount of substance (i.e. amounts of all reactants and products change as $\xi$ changes, according to the stoichiometry specified in the reaction equation). As a consequence, the dimensions of chemical potential and Gibbs free energy of reaction are the same.

For other uses, the term "Gibbs energy" might refer to the Gibbs energy of a given system, and would have dimensions of energy. $G$, like the enthalpy $H$, does not have a defined reference point that is zero, so there is never a specific value associated with $G$. You can, however, use $\Delta G$ to describe the change in Gibbs energy from a defined state to another defined state. This $\Delta G$ would have dimensions of energy, and would be extensive (if you duplicate the system and look at the total, it would have a $\Delta G$ that is twice as large).

It would be easier if the symbols would indicate which quantities are per amount of substance (intensive) and which are not (extensive). Some textbooks use bold typeface for all molar quantities, but introductory textbooks are usually not rigid in terms of dimensions at all.


  I don't understand why G is extensive if it has $\pu{mol−1}$ in its units.


The Gibbs energy of reaction is not extensive. However, if you multiply all coefficients by a constant factor, you also have to multiply the Gibbs energy of reaction by the same factor. For example,

$$\ce{H2 + 1/2 O2 -&gt; H2O}\ \ \ \ \Delta_r G^\circ = \pu{−237.13 kJ mol−1}$$ 

$$\ce{2H2 + O2 -&gt; 2H2O}\ \ \ \ \Delta_r G^\circ = \pu{−474.26 kJ mol−1}$$

The first is equal to the Gibbs energy of formation of water, and the second avoids fractional coefficients. The two are different because the extent of reaction is linked differently to changes in the amount of the reactants and products.