The rules of cricket
Law 14 (Declaration and forfeiture)
1. Time of declaration
The captain of the batting side may declare an innings closed, when the ball is dead, at any time during a match.
2. Forfeiture of an innings
A captain may forfeit either of his side's innings. A forfeited innings shall be considered as a completed innings.
A captain shall notify the opposing captain and the umpires of his decision to declare or to forfeit an innings.