The length is pretty immaterial but the width is important. The racks above the seats are like bus racks, open flat racks that will accommodate almost any length. You could put skis up there although you would piss everyone else off. The space overhead is shared with everyone. My 21" carry-on roller bag fits but hangs out over the edge and makes me nervous so I usually put it behind the last row. My smaller day trekker backpack always goes overhead as it has my cameras and laptop inside.
People are pretty cooperative about making all bags fit in the space at the end of the car. You do, however, need to be sure your bag is near the top of the "pile" before arriving at your stop if it is very crowded as there won't be a lot of time to rearrange things when you get there.