Overcooking shrimp can result in a rubbery texture, so getting the timing right is important. Generally, shrimp only need about 2-3 minutes to cook through. Keep an eye on them as they turn pink and opaque, and as soon as they reach this point, you can remove them from the heat. Remember that they will continue to cook a little even after being taken off the heat, so it's better to slightly undercook them to ensure they remain tender and juicy.