There's nothing in Law 25 to cover it but if, say, a batsman decides to simply pack up and go home, it's likely that the umpires would instruct the scorers to record the batsman as having retired.
The Regulations specifically applying to any particular type of cricket match (whether that be Test cricket or just a schoolboy competition), which are separate to the Laws that apply across the game as a whole, could however allow for some form of penalty to be imposed upon a team if a batsman were deliberately so seek to frustrate the fielding side by absenting himself from the field of play for an excessive period of time.