Learn unreal

My question is: ca I learn completely the engine only studing from documentation without buying books and courses?
How long does it take to learn c++ api, blueprints system and level design with teh engine?

you can learn everything for free.
I would start here: - YouTube
do a tutorial or 2 a day and go from there onto other tutorials, eventually you will start seeing what it is you want to learn, and then search google and youtube for that tutorial, you will find resources in the documentation online and in the answerhub (here) and the forums!

Good luck!

The documentation does not really teach you much, but gives a good explanation, so it is best to read it, and combine that knowledge with free tutorials (unless you can afford better paid ones but a lot of free ones are very good)
Epic has a big library of free tutorials they made too, and free Live Training videos on their web site.

Between all of that you can learn all of the Engine.

If you want to learn the C++ part of the engine then you have to also learn the C++ language which is a subject separate from learning Unreal in general, but Unreal also contains a lot of directives that are not in native C++
that you’ll need to understand.

Programming in blueprints will teach you how the engine works and which parts do what, and that can make the C++ make more sense. You can do most things in blueprints without doing any C++ coding though.