OnBecameVisible is called when the renderer became visible by any camera.
OnBecameInvisible is called when the renderer is no longer visible by any camera.
For Example :- Let's imaging a platform where there could be enemies in the game, when they are visible on camera we want to activate patrol and deactivate it in case they are no longer visible on the screen.
Note :-
This will only work if there a renderer element (Sprite Renderer, Mesh Renderer..etc.) on the gameObject.
If you look at the scene window, the scene camera will be taken into account so you will not have the result you except.