Replacing all four at once is the simplest answer and keeps grip even at both ends of the car. It is not always necessary, but it is never wrong.
If you replace two, always fit them as a pair on the same axle, and put the new pair on the rear. That sounds counter-intuitive on a front-wheel-drive car, but worn rears let the back of the car step out first in the wet, which is much harder to correct than understeer.
Replacing a single tire is acceptable when the other three still have most of their tread and you match the same make, model and size. On all-wheel-drive vehicles, check your handbook first - many limit how much circumference difference the drivetrain tolerates.
Never mix summer and winter tires, or different tread patterns, across one axle.