Substitute teachers are there when regular teachers need backup. If the regular teacher can't make it into school on a given day, a substitute teacher is called.
Sometimes you won't know you're going into teach a class until that day, that's why you kind of have to be "on-call" as a substitute teacher. You never know when you're going to be needed. Some substitute teachers get to fill in if a regular teacher has to take an extended absence, which means you'll be there until they get back. Long-term substitute gigs can mean anything from two weeks to five months or more.
It's important as a substitute teacher to establish some ground rules when you first step into the classroom. Since you're not the regular teacher, some students may decide they don't have to follow any rules, which definitely makes "subbing" even harder. But don't worry - you've got this.