Do you have to have a PhD to be a PI on a grant for your own funding?
As Nate Eldredge points out, who qualifies as an eligible PI varies widely between different programs. However, in general, one important distinction can usually be cited: you must be a professional researcher (as opposed to a student or trainee) to be eligible to submit a direct grant. Students would normally need to have their advisors submit the grant proposals on their behalf. 

You need to consult the specific rules of the grant you're interested in applying for. Moreover, if you are at an institution that often applies for grants, you should check with the local grants administration office for more guidance. They may have internal policies regarding for whom they will submit grants.

It is also important to note that different countries and different agencies have varying standards. Here in Germany, for instance, you must have the equivalent of a doctoral degree to be eligible to be the coordinating Principal Investigator of a proposal. You can participate as a team member without a doctoral degree, but not be a principal investigator.