Who owns the intellectual property at the end of a project?

Who owns the intellectual property at the end of a project?