hey,
first of all if you are using cmakelists you should use find_package, e.g. if libtorch is in the subfolder deps then:
set(CMAKE_PREFIX_PATH deps/libtorch)
find_package(Torch REQUIRED)

This will define TORCH_INCLUDE_DIRS which are both of the folders you mentioned and should be included in your target!
From the torchconfig:
  set(TORCH_INCLUDE_DIRS
    ${TORCH_INSTALL_PREFIX}/include
    ${TORCH_INSTALL_PREFIX}/include/torch/csrc/api/include)

If you are intent on using visual studio id recommend to either use it with cmakelists or go through the cmake torchconfig to find all the relevant things to add.
From my experience torch.h gives you all the headers you will need!
But for completeness:
extension.h is just
#pragma once

// All pure C++ headers for the C++ frontend.
#include <torch/all.h>
// Python bindings for the C++ frontend (includes Python.h).
#include <torch/python.h>

torch.h is
#pragma once

#include <torch/all.h>

#ifdef TORCH_API_INCLUDE_EXTENSION_H
#include <torch/extension.h>

#endif // defined(TORCH_API_INCLUDE_EXTENSION_H)

so arguably torch.h will provide all headers if the macro is set. Hope this helps.