The cost basis is the original value of your investment—what you paid to buy the stock, including commissions. It's the starting point for calculating your profit or loss for tax purposes.
When you sell shares, under the First-In, First-Out (FIFO) methodology of calculation, it is assumed that you're selling the ones you've owned the longest first. Your cost basis for the sold shares is the price you paid for the oldest shares. If you sell for more than this basis, you have a taxable capital gain. If you sell for less, you have a capital loss.