It depends on the cause of heartburn. If it is because of an ulcer this can last a long time until treated. On average you would need to get the stomach acid in control and then it will go away. You can do this with small frequent meals,over the counter acid reducers like tums or Pepcid. Check with your doctor.