Magento 2 - Product Stock
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
echo $StockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId());
?>
or
<?php
$stockItem = $product->getExtensionAttributes()->getStockItem();
print_r($stockItem->getQty());
?>