Ravi,
If we are talking about traditional spanning tree (802.1 D), and not rapid spanning tree (802.1 W), a switch will set the aging of the MAC address table equal to the Max Age timer when it receives the Topology Change Acknowledgement from the Root Bridge. It works like this:
A switch, let’s say it is not the root bridge, has event that causes it to generate a topology change. It’s goal is to send this to the root bridge, and then it is the root bridge’s job to acknowledge this change. This acknowledgement starts with the Root Bridge and makes its way throughout the network from there. Once the other switches receive this acknowledgement, that’s their indication that they need to set the MAC address table aging to the Max Age timer value.
Rapid Spanning tree works completely differently, by the way.