The time depends specifically on what you're teaching and how much you're prepared to prep by yourself in advance. I've done classes as short as 1 1/2 hours and as long as 2 days. With my very involved 3-D projects, I almost always need 2 days if the host venue cannot ice cookies in advance, as many need completely dry topcoats in order to be detailed and assembled.
Start by defining what you are expert enough to teach and what you think students want to learn. The convergence of these two things should define the content. The content needs to be defined before you can establish how long the class will take. Then break down the steps to make them. Ask yourself how long it would take you to make those things if uninterrupted; then maybe double that time for students. You will easily spend one third to one half of any class demoing techniques before students can work on their own.