Gas pain shouldn't last more than a few hours. Contact your healthcare provider if your pain does not improve within 24 to 48 hours, or if you have bloating for more than two days.