I realize I'm late to this party, but to emphasize what Steve Hamilton said, these loans are VERY employer-specific, and the details can vary depending on which investment provider recordkeeps the retirement plan. I work for one of those companies and spend half my days processing loans from retirement plans.
Some plans allow only one loan at a time, but I've seen plans that allow 2, 5, 25, and an unlimited number of loans, as long as you don't exceed the IRS maximum of $50,000 or 50% of the vested balance, whichever is less.
For a general loan, which can be used for anything, the maximum term is usually 5 years. For home loans, I've seen it range anywhere from 10 years to 20 years.
The home loan is generally only available for buying a primary residence, and some require a signed purchase and sale agreement, while others require no documentation at all.
Processing can range from just a phone call and express mail check (you get the funds in just a couple of days), to paperwork that has to be signed by you, signed and notarized by a spouse, and signed by the employer, which can take longer.
Interest rates can vary and are generally very low (prime plus one is typical), but you are paying the interest to yourself, right back into your retirement account, rather than to a third party (which is why many people take out these loans to pay off high credit card debt). These loan are also not reported to credit agencies, so they don't affect your credit score at all.
Some repayments are done through payroll deductions (biweekly, monthly, whatever your pay schedule is), but many are now done as direct debits from your own checking or savings accounts, not through payroll. For those done via payroll deduction, if you leave the employer, some will require the loan be paid back in full or it defaults (no effect on your credit, but the outstanding balance becomes a taxable distribution with ordinary income tax and 10% early withdrawal penalty if you're under the age of 59 1/2), but some will allow you to switch to direct debit and continue the payments according to the original schedule. Those that are set up originally as direct debit payments always allow you to continue the payments if you leave employment. If you process a full payout or rollover and have an outstanding loan, the loan will default (again, no effect on credit score, but it becomes taxable).
As long as you pay the loan back, you won't pay taxes or penalties for taking the loan. However, one thing to keep in mind, which is rarely discussed, is that the interest you pay back to yourself on the loan ends up getting double-taxed (assuming you've contributed and are borrowing pre-tax funds). The principal comes out of the plan and goes back in, but the interest comes out of your pocket as after-tax money, is paid back into the plan as pre-tax money, and you pay taxes on that amount again when you withdraw the money (presumably when you're retired). The longer you stretch out the term, the more interest you'll pay, and the larger that double-taxation becomes. It's not a huge consideration, just something to be aware of.
Most plans allow you to pay the loan back in full at any time with no early payment penalties. Some will also allow you to make partial payments during the term of the loan, but some won't. The early payoff can sometimes be done at any time (even the day after you take the loan), but some do require you to wait a specific period, usually after one year.
Another thing to keep in mind is that the IRS calculation for what you can borrow is actually the lesser of A) $50,000 or B) 50% of the total vested balance minus the highest outstanding loan balance over the past twelve months. So if you borrowed $50,000, and paid it back after a month or two (you don't always have to wait a year before repaying), then you'd have to wait 10 months or so before a new loan would be available to you, because your "highest outstanding loan balance over the past twelve months" would be $50k. $50k minus $50k is zero.
And while the IRS says you can borrow 50% of the vested balance, your employer can also restrict the sources of money available to borrow against. For example, if you contribute and your employer matches, they may only let you borrow half the amount you've contributed, not the employer match.
Sorry for the long post!