Do i understand correctly that first
Object will be created on a stack (in
the function) and then will be copied
to object variable?
Yes obj is created on the stack but when you return a process called return value optimisation or RVO can prevent the unnecessary copy.
If so, is it reasonably to create an
object in the function on a heap and
to return a pointer to it instead of a
copy ?
Yes it is reasonable to create an object on the heap and return a pointer to it as long as you clearly document the client is responsible for cleaning up the memory.
However, it's better than reasonable to return a smart pointer such as shared_ptr which alleviates the client from having to remember to explicitly free the memory.