If your Metal or Food Storages are full, it is not possible to purchase more of this resource. If your Resource maximum is not enough to upgrade a building, it is required to upgrade the Storage first. If possible, you could also build another Storage building, if you have the ability to on your Base. 

You can increase the amount of Metal or Food Storage in your base by upgrading your Food or Metal Storage buildings.

Please note, the storage amount for Farms, Forges and the Watchtower are not included in the total food/metal storage of your base, that you see on the top of your screen. The Storage Capacity listed on these buildings indicates the amount that building can hold before they are full, and cannot produce any more resources.