How Long Do Onions Last?

So you stocked up on onions on the farmer’s market, and soon you realized you probably bought more than you can use in reasonable time. Do onions go bad?