cut the bag at the knot and not just rip it open. fold down the edges so it will float at the surface and then you can add the water from the tank to the bag and get the fish out of the bag with out any bag water getting into the tank
I use this method too as it helps stop potential fish diseases/parasites from the petshops water getting into the tanks water

.
I usually acclimatise fish for minimum of 30mins, but it depends on how far they have travelled (the longer they've travelled the longer i acclimatise them for). Turning off the tank lights while they are floating in their bags also helps prevent the bags getting hot while also helping lower the fishes stress levels (i usually keep the tank lights off for a hour or 2 after the fish have been released into the tank while giving the other fish a feed to distract them from the new arrivals while they settle into the tank). Small but regular additions of new tank water are much better than big but less regular flushes of new tank water into the bag.
With acclimatisation you want to do it long enough for the fish to become accustomed to the new water & its temp etc, but you also don't want to do it too long as being kept in a small stuffy confusing bag can be a very stressful experience in itself for fish. If you know the PH & temp of the tank the fish came from in the LFS in comparison to your own tanks PH & temp, this can also be quite helpful in figuring out how long you should roughly acclimatise the fish for etc.