The growth of a planetary core by pebble accretion stops at the so-called pebble isolation mass, when the core generates a pressure bump that traps drifting pebbles outside its orbit. The value of the pebble isolation mass is crucial in determining the final planet mass. If the isolation mass is very low, gas accretion is protracted and the planet remains at a few Earth masses with a mainly solid composition. For higher values of the pebble isolation mass, the planet might be able to accrete gas from the protoplanetary disc and grow into a gas giant. Previous works have determined a scaling of the pebble isolation mass with cube of the disc aspect ratio. Here, we expand on previous measurements and explore the dependency of the pebble isolation mass on all relevant parameters of the protoplanetary disc. We use 3D hydrodynamical simulations to measure the pebble isolation mass and derive a simple scaling law that captures the dependence on the local disc structure and the turbulent viscosity parameter α. We find that small pebbles, coupled to the gas, with Stokes number τ f < 0.005 can drift through the partial gap at pebble isolation mass. However, as the planetary mass increases, particles must be decreasingly smaller to penetrate the pressure bump. Turbulent diffusion of particles, however, can lead to an increase of the pebble isolation mass by a factor of two, depending on the strength of the background viscosity and on the pebble size. We finally explore the implications of the new scaling law of the pebble isolation mass on the formation of planetary systems by numerically integrating the growth and migration pathways of planets in evolving protoplanetary discs. Compared to models neglecting the dependence of the pebble isolation mass on the α-viscosity, our models including this effect result in higher core masses for giant planets. These higher core masses are more similar to the core masses of the giant planets in the solar system.