As always, we need context.
We can say, for example, I need eight hours' sleep a night if I am to function efficiently. ... eight hours of sleep is possible, but less common.
If you are asking for, for example, cloth, wood, or metal/plastic you can say I'd like two metres.
Student or Learner