Relation between frequency and energy of a photon 
*

*Why does the energy of a photon increase when the frequency increases?

*Is it the energy of the photon that defines its frequency or is it the frequency that defines its energy?
 A: 
Why does the energy of a photon increase when the frequency increases?

$E=h\nu$ is not just a relationship that applies to photons. It's a completely general quantum-mechanical relationship. It applies to electrons and golf balls. It's usually considered to be one of the basic postulates of quantum mechanics (in the form of the Schrödinger equation).
We usually don't try to explain why postulates are true. That's why they're postulates. If we hope to find a mode of explanation for a postulate, then we do have some options. One is to find some other set of postulates that looks equally plausible and does not include the postulate we're discussing. For example, we can't prove the parallel postulate within Euclid's system, but we can prove it based on an alternative Cartesian foundation in which the Pythagorean theorem is taken as a postulate.
One such axiomatization, which has been widely influential, is given in Mackey, The Mathematical Foundations of Quantum Mechanics. It looks to me like it doesn't include the Schrödinger equation as a postulate. Mackey's axioms look like this (sketched in my brief paraphrases):


*

*There is a measure on states.

*States and observables are different iff they have/give different probabilities.

*We can apply functions to measurements and get sensible probabilities

*The density matrix exists.

*The sum of disjoint questions exists.

*relationship between questions and observables

*Hilbert space

*Every nonzero question has a state for which the answer is 1.

*unitary time evolution
Postulate 9 doesn't explicitly state the Schrödinger equation in the sense that it doesn't explicitly talk about energy. However, it follows from it that we can define something like energy. So within this framework, there is a "why" answer for $E=h\nu$, but that will only be satisfying if you think Mackey's 9 postulates are themselves plausible or sufficiently supported by experiment that we should accept them as assumptions that can be used to prove other things.

Is it the energy of the photon that defines its frequency or is it the frequency that defines its energy?

In the case of a photon, both the frequency and the energy are directly measurable. (This is not the case, e.g., for an electron.) Since they're both measurable, neither has to be defined by appealing to the other. This means that quantum mechanics can potentially by falsified by measuring the energy of a photon, measuring its frequency, and showing that $E=h\nu$ is false (e.g., is a bad approximation in certain situations).
A: This is a great question, and you are right that there is something definitely not non-trivial going on here. Non-trivial relations between quantities such as frequency and energy arguably sit at the foundations of modern physics. For instance, you could ask the same question, but about mass:
Since $E = m_{rel}c^2 = \gamma m c^2$, does mass determine the energy of an object, or does its energy determine its mass?
Note that here I am using the outdated "relativistic mass" $m_{rel}$ because I think it actually clarifies this precise issue. 
What is often missed in both these cases is just how strong these equations are to be interpreted. What $E = m_{rel}c^2 = \gamma m c^2$ and $E = \hbar \omega$ (or rather the physical insights behind them) are telling us is the following
Energy, mass, and frequency all fundamentally describe the same thing.
For instance, a hot object actually has a little more mass (that you measure on a scale or by watching how it responds when you push on it) than a cool one, a moving particle exerts a slightly greater gravitational pull than a stationary one, and a higher energy state oscillates (its phase) faster than a low energy state. Of course, most of these examples are not detectable for the everyday objects around us, which is why these equivalences are so non-trival.
In fact, many physicists use so-called "natural units", in which $c$ and $\hbar$ are defined to be equal to 1.
$$c = \hbar = 1.$$
In these units, our equations read $E = m$ and $E = \omega$. This works because the form of the equations that govern physics never change if you switch from energy to frequency to (relativistic) mass. Why? Because as far as the structures of the equations are concerned, they are the same thing!
This is why these equivalences are often taken as postulates in treatments of modern physics. But they should neither be mistaken as definitions, nor causal features. They are real physical equivalences, which have real empirical implications. They are surprising because for more than a century physicists defined and measured them separately. 
When understood in this light, your question is similar to
Does having more quarters cause you to have more dollars, or does having more dollars cause you to have more quarters?
And the answer is the same: Both. Because they are equivalent.
