It all depends on the bank or lender you are using.
Some will give you a good faith estimate when you fill out an application upon request while others give it to you a few days later, but you should receive it within a three days of applying for your mortgage.
You can also request a good faith before you even apply for a loan. When you speak to a loan officer about rates and costs associated with the mortgage, you can request a good faith estimate. It is a fancy way of asking the loan officer to put everything in writing.
Hope this was helpful.