How long do sperm live inside the vagina in the presence of an iud?

Very short time. Often times the IUD itself creates a chemical or hormonal reaction inside the uterus which is immediately toxic to sperm. However, if a sperm gets through and fertilizes an egg, the IUD itself prevents the pregnancy (99% of the time) from implanting in the uterus.
About 2 days. Sperm can live in the cervical mucus glands for up to 2 days. The presence of an iud doesn't change this.