I don't think I was given a certain length of time for elevation. It is just standard procedure to keep it up and elevated when you're experiencing pain and swelling. I did the same thing as you post op. I would go to bed with it elevated but through the night I would put it down to be comfortable. I would sleep on my side with a pillow between my legs propping it up.
My suggestion would be that even though you may not be doing it all the time you might want to make sure you still do it for 20 minutes at a time several times throughout the day. I am not a doctor though.
Because I was in a cast, I would sleep with an ice pack strapped to the cast. It kept it cool but since it was not directly up against my skin I would leave it on forever. Just having the cast cooled down helps some.
I know for the month or so my foot would swell in the cast if I had it down for any extended period of time. My toes looked like vienna sausages! HAHA I would just get it up and ice it and it would go back down. There were days I couldn't wait to get home and ice because my foot felt like it was on fire from the swelling and inflammation.
Hope this helps some!