According to the Transportation Security Administration (TSA), a department of Homeland Security which is responsible for traveling safety in all forms of transportation, including air transportation, they "will screen any 'Carry-on' baggage that will fit through the x-ray machine; however, it is up to each individual air carrier as to whether the baggage fits the size restrictions for your flight."
The TSA allows passengers one small piece of luggage as a carry-on bag, as well as one "personal item," like a laptop computer, purse, briefcase, or camera case.
Most airlines set a maximum carry-on size of 45 inches--an overall size arrived at by adding the suitcase's length, width, and depth. The most popular standardized dimensions for a carry-on bag are 22" x 14" x 9". A few airlines, such as AirTran Airways, allow bags up to 55 inches overall; check with your airline before flying. Weight limits also vary; some airlines have no limit, while others have limits ranging from 16-50 pounds.
Many airlines provide a box of some type to demonstrate appropriate sizing for carry-ons; if your bag fits inside the box, it will easily fit into the overhead compartments and is therefore acceptable. Some unusually-shaped carry-ons may be rejected, even if they fit within the required 45 inch dimensions, if they will create an obvious problem fitting into the overhead compartment or under the seat.
If your bag is rejected as a carry-on after you go through security, the flight attendant will check your bag for you. International flights often have more restrictive limits than domestic flights.
Appropriate carry-on sizing is a matter of courtesy as well as practicality. Choose a bag in a size that will fit in the overhead compartment, without crowding out other passengers. Bags should also ideally fit down the aisle of a plane without bumping passengers sitting on the aisle.