This depends on the ink you're using, the quantity you're printing, and your budget.
The ink manufacturer should have provided information on curing times and temperatures - often it's printed on the bottle (or bucket as the case may be).
For waterbased inks it's often around 180 celsius (that's about 350f I think) for about four minutes. Waterbased inks can be set with a home iron, but it's a time consuming and unreliable process. Fine if you're just doing a few shirts for fun, but not much good otherwise (although I've known some people to use that method for retail sales).
If you have the money the best thing to do (whether you're using plastisol or waterbased inks) is to buy a conveyer oven designed to cure t-shirts. If you don't have the money or the space for one, the next best thing is to contact some local screenprinters and ask if they'll either let you use theirs on a per hour basis when they don't need it, or if they offer a curing service. This is a lot easier if you're using water-based ink (air dries reasonably easily) rather than plastisol. Judging by how messy your shirts got it sounds like you may be using plastisol though.
A clothes dryer generally can't be used to heat set the ink - the dryer either runs at a temperature too low to cure the ink, or if you set it hot enough to cure then it will also scorch the clothing.
A common middle ground is to use a flash curer to fully cure your t-shirt. It's not what they're designed for, but they're commonly put to that use. Just be careful where you set it up so you don't damage your other equipment, as platerns generally aren't designed to withstand prolonged exposure.
It's worth bearing in mind that properly drying and curing ink is an exact science. Too little or too much heat and the ink may not wear well in the wash, too much heat and you can also damage your clothing. You need to know what the temperature of the method you are using achieves (i.e. dryer temperature, iron temperature, etc.), and set everything else up accordingly. Often inks can set at different temperatures using different times (i.e. 9 minutes at 120, or 4 minutes at 180) so you may have multiple options, but if you don't know the temperatures your ink cures at or the temperatures of the equipment you're using you run a relatively high risk of failing to properly cure the garment.
It's actually easy if you're careful (and have the right equipment), but it can be a nightmare otherwise.