Depends on where you live. In most jurisdictions in the US it's generally OK for a homeowner to perform "like for like" replacement work on their own residence without a license or inspection. This means you can replace an existing light switch, or an outlet, or a breaker. You generally cannot run new wire or new outlets without a permit.
If you own a property but don't live there (eg, you're a landlord), it's essentially never legal. The best answer is to contact the local AHJ.
If you own a property but don't live there (eg, you're a landlord), it's essentially never legal. The best answer is to contact the local AHJ.