Although it is a simplification, it is very useful to start thinking about this question from the following vantage point:
To a first approximation, tissues regulate their own blood flow via local mechanisms, whereas the body regulates its blood pressure via centrally-mediated mechanisms.
There are exceptions to this, but bear it in mind. For when we turn specifically to the heart's own blood supply, we find this is still broadly true.
When the cardiac muscle exercises harder, it requires more energy. As usual, the energy is supplied to it via the blood stream, in the form of things like fatty acids, and then oxygen for aerobic metabolism to take place. Therefore, a heart that works harder needs more blood flow.
Since the heart (and most other tissues) are usually in the best position to say whether or not they need more blood flow, it is granted a large amount of autonomy. The presence or absence of local substances are the chief determinants of local blood flow. They dilate or constrict the coronary vessels, permitting more or less blood flow respectively.
Even these local chemicals are chosen in a clever way. By and large, whatever accumulates as a byproduct of a lack of oxygen in the heart is capable of dilating the vessels. So a heart that works harder forms more of these byproducts per second, and so causes the vessels to dilate to increase the blood flow there. These substances include things like adenosine (produced by the sequential hydrolysis of ATP) and carbon dioxide.
But the brain does get some say in how much blood goes to the heart. Like all vessels, the coronary ones are innervated by both sympathetic and parasympathetic nerves, with the former tending to constrict the arterioles (on the whole) and the latter tending to do the opposite. It should be said, though, that the parasympathetic innervation is very slight here.
However, these direct effects from the sympathetic and parasympathetic innervation of the coronary vessels are dwarfed by their indirect effects, which tend to act in opposition. For instance, a large sympathetic outflow would tend to cause the arterioles to constrict, reducing blood flow. But the sympathetic nervous system also increases the rate and strength of the heart's contractions. This causes the heart to work harder, thus causes the local methods' vasodilatatory actions to become operative. As we've said, the local effects tend to predominate, and so the heart's vessels dilate in response to a sympathetic discharge, despite its direct effects on the coronary vessels. The opposite applies with a parasympathetic discharge, again with local effects trumping the central ones.