Usually I say around 10 minutes, but you can go up to 20 (don't go longer). Also elevate as much as possible (especially the leg), you can also compress (depends on the exact nature of the injury use common sense). As soon as the practical (once the pain from movement has gone) begin ROM exercises (just slowly move through the pain-free range of motion). Never move into pain!. Once you have regained pain-free ROM, then you can begin rehab (this may take several days, or longer depending upon the injury).
Hopefully that's been of some help?