How long does it take for the pill to regulate periods?

My periods are very irregular and have been advised to take the pill to regulate them but of course am TTC so I don’t want to take it for a long time just to regulate my periods.