Commerce (as at V2) has basic stock handling that will do exactly what you mention - for each product you can set a stock level (alternatively, you can set it to unlimited stock if you wish). When orders are completed stock is debited by the amount sold (note stock is not debited when items are added to carts - which is good, because it means you don't have to deal with not being able to sell things that are locked up in stale carts).
Commerce will not let you sell out of stock items, and there are template tests you can use to display the stock state in any way you choose (be careful with caching in this area!).
Note that the stock handling is fairly simplistic - e.g. I am pretty sure that there is no automatic return handling (so if you e.g. cancel/refund an order, it won't automatically add the stock back).
If you need stock handling beyond this then you would need to look at building a plugin specific for you needs (or one that integrates a sophisticated inventory handling system).