What determines how D.Va's defense matrix meter is consumed and replenished?

It has a resource bar that is completely time based. It will block for 4 seconds at maximum capacity or until you release the button.

Once used it will cool down and then start to regenerate after 1 second. It charges from 0 to 100% in ten seconds. This equals about .4 seconds of use time per 1 second of charging time.