Period Question

How long does it take your period to have a regular cycle because sometimes I miss a month or two and then my period comes out of no where.