Sometimes, but it is rarely the simple upgrade it sounds like, and more power does not usually produce more speed on a displacement hull.
A larger engine forces a chain of checks: structure and engine beds for the weight and thrust, gearbox and shaft or drive rating for the increased torque, gear ratio and propeller to convert the power without overloading the engine, exhaust sizing for the increased gas flow, raw-water and coolant capacity for the increased heat, engine-room ventilation for the increased air demand, and fuel supply and tank capacity for the increased consumption.
Then the paperwork: the vessel's plate information, registration and survey status where it applies, and your insurer, who may reasonably want to know the installed power has changed.
Weight and its distribution deserve particular attention on a sailing yacht, where a heavier engine in the wrong place changes trim and handling. In most repowers the right answer is a modern engine of similar output, correctly propped — that alone often delivers the improvement the owner was chasing.