According to skinner's principles of instrumental conditioning, reinforcement and punishment must come immediately after the response.
Operant conditioning is a method of learning that occurs through rewards and punishments for behaviour. Operant behavior is said to be "voluntary": for example, the child may face a choice between opening the box and petting a puppy.