The American Bar Association has general rules on fees you can find here: ABA Model Rules of Professional Conduct Rule 1.5.
I will answer this question as it applies in the jurisdiction where I practice divorce and family law (Utah). Each jurisdiction has its own rules governing the fees attorneys charge.
According the Utah Rules of Professional Conduct Rule 1.5 (Fees):
(a) A lawyer shall not make an agreement for, charge, or collect an unreasonable fee or an unreasonable amount for expenses. The factors to be considered in determining the reasonableness of a fee include the following:
(1) the time and labor required, the novelty and difficulty of the questions involved and the skill requisite to perform the legal service properly;
(2) the likelihood, if apparent to the client, that the acceptance of the particular employment will preclude other employment by the lawyer;
(3) the fee customarily charged in the locality for similar legal services;
(4) the amount involved and the results obtained;
(5) the time limitations imposed by the client or by the circumstances;
(6) the nature and length of the professional relationship with the client;
(7) the experience, reputation and ability of the lawyer or lawyers performing the services; and
(8) whether the fee is fixed or contingent.
(b) The scope of the representation and the basis or rate of the fee and expenses for which the client will be responsible shall be communicated to the client, preferably in writing, before or within a reasonable time after commencing the representation, except when the lawyer will charge a regularly represented client on the same basis or rate. Any changes in the basis or rate of the fee or expenses shall also be communicated to the client.
(c) A fee may be contingent on the outcome of the matter for which the service is rendered, except in a matter in which a contingent fee is prohibited by paragraph (d) or other law. A contingent fee agreement shall be in a writing signed by the client and shall state the method by which the fee is to be determined, including the percentage or percentages that shall accrue to the lawyer in the event of settlement, trial or appeal; litigation and other expenses to be deducted from the recovery; and whether such expenses are to be deducted before or after the contingent fee is calculated. The agreement must clearly notify the client of any expenses for which the client will be liable whether or not the client is the prevailing party. Upon conclusion of a contingent fee matter, the lawyer shall provide the client with a written statement stating the outcome of the matter and, if there is a recovery, showing the remittance to the client and the method of its determination.
(d) A lawyer shall not enter into an arrangement for, charge, or collect:
(1) any fee in a domestic relations matter, the payment or amount of which is contingent upon the securing of a divorce or upon the amount of alimony or support, or property settlement in lieu thereof; or
(2) a contingent fee for representing a defendant in a criminal case.
(e) A licensed paralegal practitioner may not enter into a contingent fee agreement with a client.
(f) Before providing any services, a licensed paralegal practitioner must provide the client with a written agreement that:
(1) states the purpose for which the licensed paralegal practitioner has been retained;
(2) identifies the services to be performed;
(3) identifies the rate or fee for the services to be performed and whether and to what extent the client will be responsible for any costs, expenses or disbursements in the course of the representation;
(4) includes a statement printed in 12-point boldface type that the licensed paralegal practitioner is not an attorney and is limited to practice in only those areas in which the licensed paralegal practitioner is licensed;
(5) includes a provision stating that the client may report complaints relating to a licensed paralegal practitioner or the unauthorized practice of law to the Office of Professional Conduct, including a toll-free number and Internet website;
(6) describes the document to be prepared;
(7) describes the purpose of the document;
(8) describes the process to be followed in preparing the document;
(9) states whether the licensed paralegal practitioner will be filing the document on the client’s behalf; and
(10) states the approximate time necessary to complete the task.
(g) A licensed paralegal practitioner may not make an oral or written statement guaranteeing or promising an outcome, unless the licensed paralegal practitioner has some basis in fact for making the guarantee or promise.
Reasonableness of Fee and Expenses
 Paragraph (a) requires that lawyers charge fees that are reasonable under the circumstances. The factors specified in (a)(1) through (a)(8) are not exclusive. Nor will each factor be relevant in each instance. Paragraph (a) also requires that expenses for which the client will be charged must be reasonable. A lawyer may seek reimbursement for the cost of services performed in-house, such as copying, or for other expenses incurred in-house, such as telephone charges, either by charging a reasonable amount to which the client has agreed in advance or by charging an amount that reasonably reflects the cost incurred by the lawyer.
Basis or Rate of Fee
 When the lawyer has regularly represented a client, they ordinarily will have evolved an understanding concerning the basis or rate of the fee and the expenses for which the client will be responsible. In a new client-lawyer relationship, however, an understanding as to fees and expenses must be promptly established. Generally, it is desirable to furnish the client with at least a simple memorandum or copy of the lawyer’s customary fee arrangements that states the general nature of the legal services to be provided, the basis, rate or total amount of the fee and whether and to what extent the client will be responsible for any costs, expenses or disbursements in the course of the representation. A written statement concerning the terms of the engagement reduces the possibility of misunderstanding.
 Contingent fees, like any other fees, are subject to the reasonableness standard of paragraph (a) of this Rule. In determining whether a particular contingent fee is reasonable, or whether it is reasonable to charge any form of contingent fee, a lawyer must consider the factors that are relevant under the circumstances. Applicable law may impose limitations on contingent fees, such as a ceiling on the percentage allowable, or may require a lawyer to offer clients an alternative basis for the fee. Applicable law also may apply to situations other than a contingent fee, for example, government regulations regarding fees in certain tax matters.
Terms of Payment
 A lawyer may require advance payment of a fee but is obligated to return any unearned portion. See Rule1.16(d). A lawyer may accept property in payment for services, such as an ownership interest in an enterprise, providing this does not involve acquisition of a proprietary interest in the cause of action or subject matter of the litigation contrary to Rule 1.8(i). However, a fee paid in property instead of money may be subject to the requirements of Rule 1.8(a) because such fees often have the essential qualities of a business transaction with the client.
 An agreement may not be made whose terms might induce the lawyer improperly to curtail services for the client or perform them in a way contrary to the client’s interest. For example, a lawyer should not enter into an agreement whereby services are to be provided only up to a stated amount when it is foreseeable that more extensive services probably will be required, unless the situation is adequately explained to the client. Otherwise, the client might have to bargain for further assistance in the midst of a proceeding or transaction. However, it is proper to define the extent of services in light of the client’s ability to pay. A lawyer should not exploit a fee arrangement based primarily on hourly charges by using wasteful procedures.
Prohibited Contingent Fees
 Paragraph (d) prohibits a lawyer from charging a contingent fee in a domestic relations matter when payment is contingent upon the securing of a divorce or upon the amount of alimony or support or property settlement to be obtained. This provision does not preclude a contract for a contingent fee for legal representation in connection with the recovery of post-judgment balances due under support, alimony or other financial orders because such contracts do not implicate the same policy concerns.
Disputes over Fees
 If a procedure has been established for resolution of fee disputes, such as an arbitration or mediation procedure established by the Bar, the lawyer must comply with the procedure when it is mandatory, and, even when it is voluntary, the lawyer should conscientiously consider submitting to it. Law may prescribe a procedure for determining a lawyer’s fee, for example, in representation of an executor or administrator, a class or a person entitled to a reasonable fee as part of the measure of damages. The lawyer entitled to such a fee and a lawyer representing another party concerned with the fee should comply with the prescribed procedure.
 This rule differs from the ABA model rule.
[8a] This rule differs from the ABA Model Rule by including certain restrictions on licensed paralegal practitioners.
Utah Family Law, LC | divorceutah.com | 801-466-9277