how to stop the relay after it is getting on and let the sensor get the result
If all the pumps have to work for pump_periods[i] time on every loop, and you will have a long delay() anyway, you could replace the for loop with:
for (int i = 0; i &lt; jml_pump; i++) { // For every pump:
  digitalWrite(pump_pins[i], 1);     // Start pump i
  delay(pump_periods[i]);            // Wait for pump_periods[i] ms
  digitalWrite(pump_pins[i], 0);     // Stop pump i
}
delay(120000);                       // Wait 2 minutes until mixed

This will block the loop, but you will have a long delay anyway. The pumps will work sequentially, and not at the same time.
Is that what you want?