In a sealed metal can....probably a few years. In a plastic container that has been opened, probably a few months. Brake fluid absorbs moisture and the boiling point decreases. I think 3% is the limit for proper function.
Once opened they are trash very quickly. I once demonstrated to a non-believer by opening a new bottle and leaving it in a locked room overnight. It was overflowing the next morning from the moisture it absorbed.