Re: Resigning from Starfleet
There doesn't seem to be any compulsory length of stay requirement in Starfleet from what I can tell. If you want to resign, it looks like you easily can, though it might be a few days or weeks before you're able to transfer from a ship to a civilian transport or planet.
Dr. Howard, Dr. Fine, Dr. Howard: For Duty and Humanity!
--Men in Black, 1934.