I believe it's similar to any mortgage, except that with the "doctor loans" you get two major benefits: 1) you aren't penalized for putting little or no money down (regular mortgages would require you to pay PMI, which is an extra monthly insurance cost in case you default on the loan and take off), and 2) the large amount of med school debt you may or may not have is not considered in the application.
So with a "doctor loan" the amount you can borrow has nothing to do with your amount of student loan debt, if I understand it correctly. Otherwise though it's the same as with any other mortgage; your total borrowing power is capped at a certain percentage of your monthly income, and is adversely affected by other debt, such as credit card debt or car loans. This means it will vary depending on what your salary will actually be (which can range from ~$38,000 to $48,000 depending on where you're doing your residency). The actual percentage may vary from lender to lender (I'm not sure of this), but they all basically won't allow you to borrow so much that your mortgage payment + homeowners insurance + property taxes will end up eating too large a chunk of your paycheck. A number of mortgage sites have "how much can I afford" calculators that can help you estimate this.
Here's the eloan.com calculator:
http://www.eloan.com/s/affordability/calc_afford?sid=Ar6S0r7EWUOTFUyesBOt34b9iHE&user=&mcode=
This calculator is somewhat limited in its utility as you can only choose from a 15-yr or 30-yr mortgage and assumes that you'll be penalized for putting less than 20% down (which is true for a standard mortgage, but NOT for a "doctor loan"), but it helps give you a basic idea. Use something like 6 or 6.5% for the interest rate.
(if the link doesn't work just go to
www.eloan.com and click "tools and calculators," then select "home affordability calculator" from the pull-down menu and click "go")
Here's another calculator:
http://home.ingdirect.com/products/products.asp
(click the "solutions calculator" link; note that this automatically subtracts 20% from the property value, assuming you'd be making a 20% down payment to avoid PMI, which again isn't necessarily the case with a "doctor loan")
By the way, I don't believe that a good credit score significantly affects the total amount of loan you'd qualify for. Rather, it may help you get a better interest rate, so you'd pay less in the long run.
On a salary of around $40,000, I think you can reasonably expect to borrow $160,000, maybe $180,000 if you're lucky. But perhaps the doctor loans programs allow you to borrow more...does anyone know???