Does Starfleet have a Marine Corps, yes or no? (If yes, WTF do they do during peacetime?) It's the most popular fanon bit ever, but I don't think I've ever heard it resolved canonically.
Whether they are called the Starfleet Marines or not is a matter of debate since it has never been stated in canon, but there definitely are dedicated ground combat forces in both wartime and peacetime.
- In ENT they have the MACOs, which use Army/Marines ranks and are part of a separate military organization from Starfleet.
- In TMP there are guards aboard the Enterprise dressed in full combat armor including flak jackets and helmets. In non-canon background material for TMP the Arcturan clones are mentioned as often being used as ground forces for Starfleet.
- In TFF there was a special forces-like ground combat unit with their own uniforms and equipment including foldable riot shields. In non-canon background material for TFF these units were mentioned as being Marines.
- In TUC Colonel West holds an Army/Marines type rank and was planning a ground rescue mission on Rura Penthe. Colonel West's character was stated in non-canon background material as being based on Marine Colonel Oliver North. Colonel West's Admiral-equivalent rank could be accurate and the Colonel title be a form of address, as in the British "Colonel of the Regiment" which can be a General.
- In DS9 'Nor the Battle to the Strong' and 'The Siege of AR-558' we see dedicated ground combat units referred to as "ground forces" in dialogue who have their own unique style of uniforms and armored flak jackets.
As far as what they could do in peacetime, they could serve in much the same way the modern day Marines and special operations forces do:
- Embassy protection abroad.
- Security forces and boarding parties aboard ships.
- Peacekeeping operations.
- Relief efforts.
- Search and rescue operations.
- Rapid reaction force.
- Hostage rescue.
- VIP or asset protection.
- Presidential transport and protection.
- Training of domestic and foreign military and security forces.
Images from here:http://www.st-v-sw.net/STSWground-defense.html