If you have a flat, and are worried about rim damage, you need to stop driving on it right now. The potential for damage is going to be variable depending on the roads, specifically if you go up and down hills, or make a lot of turns. However, damage is going to occur very rapidly no matter what unless the tire is replaced. The window is usually somewhere in the range of a few hours.