Profit
Profit is the surplus remaining after total expenses are deducted from total income. Expenses include explicit costs of doing business, such as depreciation, interest and taxes (not GST). Income is calculated at the time the sale is booked, rather than when full payment is received. Likewise, expenses are calculated at the time the purchase is made, rather than when you pay the bill.
Cash Flow
Cash flow is the difference between inflows (actual incoming cash) and outflows (actual outgoing cash). Income is not counted until payment is received and expenses are not calculated until payment is made. Cash flow also includes the introduction of working capital from investors or debt financing.
Cash comes in from customers who are buying your produces or services, or, say, from the sale of fixed assets, GST refunds or owners introducing funds. If a customer does not pay at the time of purchase, then some of your cash flow will come from accounts receivable. On the other hand, cash goes out of your business in the form of payments for expenses, like rent or interest, repayments of principal on loans, purchase of assets, payment of taxes/GST and accounts payable.
Cash Flow and Profit Don't Always Match
Say you are in the business of investing in residential rental property and you make income from rents collected. The business can be profitable, as the rental income covers interest, rates, insurance etc, but the business can still go bankrupt from cash flow problems.
You must pay the interest on the mortgage each month, or the rates every 3 months, but what happens if your tenant does not pay their rent to you for 2 or 3 months? Then you will need to get finance from another source to survive until the rent is paid. If you don’t get that alternative finance and the mortgage is not paid, then the bank could force you out of business.
Summary
Profit is the surplus remaining after total expenses are deducted from total income. Cash flow is when you actually get and pay the cash. In the long term, you must get profitable or find another source of funds, i.e. private means, to keep giving you cash to make up for your losses. In the short term, even if you’re profitable, you survive or fail based on whether you have cash to pay the bills. That’s why they say "Cash Flow or Cash is King".