The process by which a newly synthesized protein acquires its functional three-dimensional structure.