The relevant piece on limiting appointments:
At USMA:
http://www.law.cornell.edu/uscode/text/10/4342
(g) The Secretary of the Army may limit the number of cadets authorized to be appointed under this section to the number that can be adequately accommodated at the Academy, as determined by the Secretary after consulting with the Committee on Armed Services of the Senate and the Committee on Armed Services of the House of Representatives, subject to the following:
(1) Cadets chargeable to each nominating authority named in subsection (a)(3) or (4)
may not be limited to less than four.
(2) If the Secretary limits the number of appointments under subsection (a)(3) or (4), appointments under subsection (b)(1)–(4) are limited as follows:
(A) 27 appointments under subsection (b)(1);
(B) 27 appointments under subsection (b)(2);
(C) 27 appointments under subsection (b)(3); and
(D) 13 appointments under subsection (b)(4).
(3) If the Secretary limits the number of appointments under subsection (b)(5), appointments under subsection (b)(2)–(4) are limited as follows:
(A) 27 appointments under subsection (b)(2);
(B) 27 appointments under subsection (b)(3); and
(C) 13 appointments under subsection (b)(4).
(4) The limitations provided for in this subsection do not affect the operation of subsection (e).
(h) The Superintendent shall furnish to any Member of Congress, upon the written request of such Member, the name of the Congressman or other nominating authority responsible for the nomination of any named or identified person for appointment to the Academy.
Navy is a bit different, it doesn't have the minimum of 4 requirement:
http://www.law.cornell.edu/uscode/text/10/6954
"(a) The authorized strength of the Brigade of Midshipmen (determined for any year as of the day before the last day of the academic year) is 4,400 or such lower number as may be prescribed by the Secretary of the Navy under subsection (h).
Subject to that limitation, midshipmen are selected as follows:"
But it has a lot less flexibility on changes in the class size:
"For purposes of the limitation in subsection (a) establishing the aggregate authorized strength of the Brigade of Midshipmen, the Secretary of the Navy may for any year permit a variance in that limitation by not more than one percent. In applying that limitation, and any such variance, the last day of an academic year shall be considered to be graduation day.
(h)
(1) Beginning with the 2003–2004 academic year, the Secretary of the Navy may prescribe annual increases in the midshipmen strength limit in effect under subsection (a). For any academic year, any such increase shall be by no more than 100 midshipmen or such lesser number as applies under paragraph (3) for that year. Such annual increases may be prescribed until the midshipmen strength limit is 4,400.
(2) Any increase in the midshipmen strength limit under paragraph (1) with respect to an academic year shall be prescribed not later than the date on which the budget of the President is submitted to Congress under section 1105 of title 31 for the fiscal year beginning in the same year as the year in which that academic year begins. Whenever the Secretary prescribes such an increase, the Secretary shall submit to Congress a notice in writing of the increase. The notice shall state the amount of the increase in the midshipmen strength limit and the new midshipmen strength limit, as so increased, and the amount of the increase in Senior Navy Reserve Officers’ Training Corps enrollment under each of sections 2104 and 2107 of this title.
(3) The amount of an increase under paragraph (1) in the midshipmen strength limit for an academic year may not exceed the increase (if any) for the preceding academic year in the total number of midshipmen enrolled in the Navy Senior Reserve Officers’ Training Corps program under chapter 103 of this title who have entered into an agreement under section 2104 or 2107 of this title."