No, there is no set time period before the first mortgage payment is due.
Typically, at closing, the buyer pays an amount for interest which is calculated as a daily amount (mortgage amount X interest rate = annual amount of interest payment. This annual interest payment is then divided by # of days in the year (365 or 366 in leap year) which gives the daily interest rate. When you multiply this daily amount by the number of days in a particular month, you then have the interest payment for that month.
At closing, the daily interest amount is shown and is multiplied by the number of days in the month that matches the # of days remaining in the month after the date of closing. So, if you close on the 10th day of June (a 30-day month) you'll pay interest for 20 days till the end of June. This means your 1st mortgage payment would be August 1st or 51 days after closing.
If you had enough cash at closing and you paid interest for 20 days for June and then 31 days for July, then your 1st mortgage payment would be due September 1st or 82 days after closing.
There's a real estate principle that states, "Interest is paid in arrears." This means that interest earned on the mortgage balance by the lender, for let's say July 1 to July 31st is not due for payment until August 1st by the borrower (you).
Hope this helps.