Whatever you come into a marriage with as your own property remains your own property. You can change the "character" (that's the legal term for "who owns it") of the property by a written statement, but otherwise it's yours to keep. But so are the debts that you bring into your marriage -- yours to keep.
During Marriage: What's Ours is Ours
Any money you make or anything your work "earns" while you are married is considered community property. If you invest in a retirement account, work toward bonuses and/or promotions -- THAT too is community property. And so are the debts that you incur during marriage. At dissolution, if a spouse can show that the other spouse used the community property money (or work) for a personal purchase or purpose, that can be counted against that other spouse.
Also During Marriage: What Was Someone Else's is Mine
If you are given a gift while you are married (to you individually and not as a couple), that gift is separate property. So is any inheritance you receive while you are married, again as long as you are named individually and not as a couple.
Also During Marriage: What Was Mine is Kind of Ours
If you bought something before marriage (i.e. a separate property house), and you took out a mortgage in your name also before marriage (a separate property debt), but you continue to make payments on it while you're married (community property money), then PART of that house belongs to the community -- the community has an "interest." There is a formula that determines that interest, but it's a bit convoluted for words. The formula uses the purchase price of the home, the amount of the original loan, the house's value on the date of marriage, the amount owed on the date of marriage, the house's value on the date of separation, and the amount owed on the date of separation (minus any HELOCs or 2nd mortgages taken out during marriage which would be considered community property debt). Using those numbers the formula determines how much belongs to you and how much is community property (and half of that is yours too)
After Separation: What's Mine is Mine again -- mostly
California courts consider the "community" to end on the date of separation in either a dissolution or legal separation case. This is the date that the court declares, and it is based on the date of separation each party enters on the Petition and the Response. That date is the starting line of where what you earn is now entirely yours and what you buy with those earnings is also entirely yours. It is an important legal distinction when it comes to dividing the property of a marriage. It is also the date when any debt you incur is considered to be your personal debt and not from your marriage.