What does real, user and sys from the output of time mean?

The time command found in linux and other *nix OSes output the amount of time a program took to run. The output is split into 3 categories, real, user and sys. For example:

$ time foo
real        0m0.003s
user        0m0.000s
sys         0m0.004s

What does real, user and sys mean?

Source