When you leave an ice pack on an injury too long it doesn't allow the tissues to warm back up again which promotes healing.
Leaving the ice pack on too long or longer than 20 minutes at a time will prevent the injury from healing fast enough like it would if you only left the ice pack on the injury for 20 minutes and then removed the ice pack and returned the ice pack to the injury again 20 minutes later.
Also be sure to never put the ice pack directly on your skin otherwise you risk frostbite so wrap the ice pack in a paper towel or regular wash cloth before applying the ice pack directly to your skin.
Usually however ice packs aren't needed after the first 24 hours unless your doctor recommends using an ice pack to reduce pain or any active swelling.