Depends on who knows about it. If it's between two people, it can last as long as they want it too. That's called friends with benefits.
As for a hookup as in, you are having sex and everyone knows, that all depends on whether or not you or your partner care what other people think. It's all at the discretion of the people who are hooked up. Unless they decide to move it to something more, it doesn't have to change into a relationship. If, for example, the male suddenly had sex with someone other then the person he was "hooked up" with, and she flips out like it wasn't fair, then that is probably due to miscommunication. This often happens when a guy wants a relationship but the girl doesn't (happens more often then you'd think) and the guy says oh alright and then the girl flips. Though, it goes both ways.
Basically no, there is no set length.