I see the two terms as unrelated. Josh Gathany's answer is very good. But neither term has a single meaning.
I define "philosophy" as "the field of study that asks questions about things that other fields generally take for granted." For example, science tends to assume that the physical world exists. Philosophy asks if it does. Religion tends to assume a certain position with regard to the idea of a God or Divine Being. Philosophy inquires into this.
A theory is a proposed explanation of something. There are theories in philosophy, in history, in literary criticism. A medical diagnosis is a theory. The clearest definition of the term "theory" comes in science. Science is the process of observing the world and trying to explain it in ways that make it predictable and give us some degree of control over our actions and their effects.
The scientific method progresses through steps. The first is observation. We look and describe what we are seeing. Then we ask "Why is this happening?" We come up with our first tentative answer, which is called a hypothesis. A hypothesis is an idea, a possibility, but it is below the level of a thesis, a clear statement of a theory. We may come up with several hypotheses.
We test our hypotheses with further observation and with experiments. We apply logic. Certain hypotheses are eliminated. How? Well, if they were true, then, in this situation or experiment, X would happen. But X did not happen.
A hypothesis that survives this testing and can't be disproven (yet) is a theory. It may be wrong. But so far, we have a lot of evidence that says it is not wrong.
So a theory is an explanation of how some part of the world works that has not yet been proven false.
If a theory lasts a long time and seems to have no exceptions, we call it a law. So the Law of Gravity (formulated by Newton and revised by Einstien) is a theory with no known exceptions and few gray areas.
So, philosophy is an area of inquiry. Theory is a statement about how the world works that is not yet proven false. (By the way, science cannot discover the truth; it can only come up with things that have not been proven false yet.)
In personal use, we say, "my philosophy" meaning "the way I look at life, my conclusions after some questioning." A person may say, "my theory," meaning "my explanation of this particular thing." In this usage, the terms are somewhat similar, but a person's philosophy is about the big picture; a theory is about something specific.