Gas is a small amount of ethereum paid to people who use their computers to record transactions and do other software actions.
Gas is calculated by multiplying a very small amount of ethereum, known as gas price or gwei, and multplying that by how much gwei you want to spend known as gas limit. Because 1 ethereum = 1 billion (1,000,000,000) gwei, gas costs are usually very small, around several dollars. If the amount of gas is insufficent to complete the work, the work will fail. On the other hand, you can pay a bit more gas and expect the computers to complete your task sooner.