When you press the button, the switch closes and the bell rings. (Normally, you'd use your finger but you can use your mouse for this one!) Release the button, the switch opens and the bell stops. Basic stuff, found in zillions of doorbells around the world!
In the second picture, pressing the button switches the light on but, this time when you release the button, the switch stays closed - leaving the light on - until the button is pressed again. More basic stuff - just like bedside lamps everywhere.
The switch in the top picture is called a momentary contact switch. The switch in the lower picture is called a latching contact switch.