What is the exact difference between these two values in RSTP and what values it can hold. How is the switch's behavior changes as these values are changed.
The Message Age field in STP is similar to a TTL field in IP packet and is supposed to
—prevent BPDUs being forwarded between STP-aware switches endlessly —define a maximum lifetime for a particular BPDU to prevent processing old and possibly outdated information
The Message Age is set to 0 at the root bridge. Every other non-root switch will increase the Message Age field by one in the received BPDU when relaying it via its own ports. Moreover, on each non-root switch, the BPDU itself will age out in (Max Age - Message Age). This makes sure that the more hops this BPDU has traversed from the root, the sooner it will expire.
Message age - Root Bridge sends out BPDU with message age as 0. And the receiving subsequent non-root bridges adds the value 1 to it. Effectively, this values says how far a bridge is from the root bridge. It is not a fixed value.
Max age - If 3x hello packets (which is sent out every 2s) are missed, a bridge waits for the configured max age time (default 20s) to conclude link failure to root bridge and initiates topology re-convergence.