There is nothing in the Laws of the Game about this, therefore there is no restriction in general: the player may bat as soon as their team's innings commences.
However, the standard ICC Test Match Playing Conditions contain the following clause (2.2.2):
The player [who has been off the field] shall not be permitted to bat in the match until his team’s batting innings has been in progress for the length of playing time that is equal to the unexpired penalty time carried forward from the previous innings, subject to a maximum cumulative penalty time of 120 minutes. However, once his side has lost five wickets in its batting innings, he may bat immediately.
i.e. a player who was off the field for the whole innings can only bat once one of the following happens:
- The batting team's innings has lasted as long as the previous innings
- Two hours have elapsed
- The fifth wicket has fallen
The ODI and Twenty20 International Playing Conditions contain the same clause, except that there is a maximum penalty of 40 minutes in T20 internationals.