This can either be a bad heater core or just something as simple as having low coolant. When the coolant runs low it can affect the heater core by not supplying a constant source of heat. Always make sure the coolant is topped off first.