Most people wire them to any source that is powered when the "key" is on.
The only problem with that is if you leave the key on inadvertently, the hour meter will run until the battery goes dead.
You could get a normally open oil pressure switch that would connect power only when the engine is running but that's WAY over kill!!
Depending on where you mount the hour-meter, Just connect it to any power source that is on when the ignition is powered.
Many hour meters will operate as low as 6-7vdc ...... so you could also connect it directly to the coil + terminal if you mount it in the engine compartment.
The easiest way is to power it from the "Run" circuit of your ignition switch, the purple wire. But you MUST turn your key switch to off, or, as HT said, it will continue to rack up hours...
For an inboard it is best to install a pressure switch on the engine block. This way the hour meter is a true reading of actuall engine hrs. You may already have one on the engine. In this case you can tie into it for your hour meter.