The most obvious rule is that the less severe the charged crime, the more sensible it is to represent yourself. Defendants charged with minor traffic offenses should rarely hire an attorney, while defendants charged with serious felonies should rarely be without one.
The most critical piece of information in making a decision about self-representation is what the likely punishment will be if convicted. It is almost always wise to be represented by an attorney when jail time is possible. And remember, convictions for even seemingly minor offenses can carry hidden downstream costs, such as more severe punishment for a second conviction, increased insurance rates, loss or suspension of a professional license, and deportation of non-citizens. (To find a criminal defense attorney near you, check out Nolo's trusted Lawyer Directory.)
For more information, see Does Self-Representation in a Criminal Case Ever Make Sense?