I have run below code
use Magento\Framework\App\Bootstrap;
use Magento\Catalog\Block\Product\Image;
include("app/bootstrap.php");
//$product_id = 4814;
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$simple_product = $objectManager->create('\Magento\Catalog\Model\Product');
$storeId = '1'; //Store ID
$product_id = 4814;
$productFactory = $objectManager->get('\Magento\Catalog\Model\ProductFactory');
$product = $productFactory->create()->setStoreId($storeId)->load($product_id);
echo $imagePath = '/var/import/bulb.jpg'; // path of the image
//exit();
$product->addImageToMediaGallery($imagePath, array('image', 'small_image', 'thumbnail'), false, false);
$product->save();
And getting following error
Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: The image doesn't exist. in C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product\Gallery\Processor.php:145 Stack trace: #0 C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product.php(1577): Magento\Catalog\Model\Product\Gallery\Processor->addImage(Object(Magento\Catalog\Model\Product\Interceptor), '/var/import/bul...', Array, false, false) #1 C:\xampp\htdocs\magento23\generated\code\Magento\Catalog\Model\Product\Interceptor.php(895): Magento\Catalog\Model\Product->addImageToMediaGallery('/var/import/bul...', Array, false, false) #2 C:\xampp\htdocs\magento23\image.php(22): Magento\Catalog\Model\Product\Interceptor->addImageToMediaGallery('/var/import/bul...', Array, false, false) #3 {main} thrown in C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product\Gallery\Processor.php on line 145