Bloating usually goes away within a few hours, as the excess gas will pass from your system.
However, if your bloating lasts for a long time (3 weeks or more) or you get bloated very often (more than 12 times a month) you should speak to your GP.
Severe or persistent bloating can be a symptom of an underlying health condition like IBS, coeliac disease, or ovarian cancer.