You can refinance your mortgage as soon as you can find a lender willing to do it. Most banks require at least 12 months before you can refinance a mortgage, but this is not written in stone. The guidelines are changeable, and there are undoubtedly lenders out there who will refinance after a much shorter time.
Your current mortgage might have a clause requiring a “seasoning period.” This means that you are not permitted to refinance your mortgage until you have lived in your home for one or two years. Some lenders also add on early payoff penalties, meaning that you will have to pay a penalty if you pay off the mortgage before a certain time period. Such an early payoff penalty makes refinancing less attractive because of the added cost to you.