Yes, online casinos know how much you win naturally. There is a detailed history of your deposits and withdrawals where you can keep an eye on how much you have spent at any one point. Casinos will also make sure that the money you deposit actually meet your financial means, as part of AML and KYC practices that are required by all regulators.