In Star Wars: Episode II: Attack of the Clones, Mace Windu says that Count Dooku is a former Jedi. Mace speaks highly of him, so it's clear that Dooku left the order on good terms. Later in the same film, Obi-wan makes it sound like it would be difficult for Anakin to leave the Jedi to be with Padme. Why would Dooku be able to leave the Jedi order, but Anakin not? What's the process to do so?
I can't seem to find the exact way that Jedi leave the order (presumably, they would tell the Council they wanted to leave, but this is only a possibility, not necessarily the way that they would leave), but it does seem that Dooku is a special case, as he was of a noble family and he would have had a life that he could return to outside of the Jedi Order. Few other Jedi could say this, most having entered into the Jedi order at a very young age.
An about.com article notes that Anakin could probably have left the Order, but that, had he done so, he probably would have been even more susceptible to Chancellor Palpatine's manipulation and, secondly, would have had no one to attempt to keep him away from the dark side.
Wookieepedia says that the way of the Jedi Order is was a "life-long path" and that "a Jedi usually remained part of the Order their entire life". Although this answer gives no definite insight on how a Jedi might leave the Order, I hope that this answer might help you to better understand why a Jedi might choose to leave it.
In the "new order" (in the 3rd Dark Nest trilogy), Luke ask Jedi to leave the order if they cannot put the order as their first priority.
Tenel Ka decides that she cannot be both a Jedi and the Hapan Queen and she surrender her lightsaber.
From the "The Swarm War" book:
"She held out her lightsaber to Luke. “It is with great regret that I must surrender this. I simply cannot fulfill the duties of a Knight in the Jedi order.
I understand.” Luke accepted Tenel Ka’s lightsaber, then pushed it back into her hand. “But please keep your lightsaber. You earned the right to carry it, and that can never be taken away.”
I would assume that when a Jedi leaves, he/she/it will leave all jedi attributes (robe, lightsaber, holocrons, ...) and become a civilian.
The Jedi have a hall in which they commemorate every Master which has peacefully left the order, i.e turning to the Dark Side means you don't get commemorated, Dooku was commemorated there when he initially left.
This tells us that even if it's harsh only the Masters count and to commemorate every Knight or worse Padawan who left would be a exercise in futility as their numbers are much much greater.
Though I would suspect that it would also be easier to leave the lower on the ladder you are.
The EU showed us that Force Sensitives which didn't make the cut for Padawans, had other less glamorous roles they could fulfil in auxiliary organization to the Jedi Order (healing, education, agriculture) given that these organizations have recruits means that former younglings who didn't make the cut still felt they would have a better life in these organization rather then returning and trying to be a slicer (programmer) for example.
That does not speak well of the non-Force related education the Temple gives its younglings.
Presumably Anakin could have just left the order and married Padme, but remember he went from a lowly slave to Jedi prodigy, the super star of his generation, going from that to even the status of war hero/Senatorial husband was a downgrade.
And of course he sincerely believed the only way he could save his wife was through the Force, without the Jedi's accumulated knowledge it would have been impossible.
References: Jedi Service Corps: The organization I spoke of which took in, Force Sensitives which could not make the cut for/had the desire to serve in the Jedi Order proper. Interestingly it has it's roots in Jedi who did not want to serve in a martial manner in the last great open war the Jedi had with the Sith.
The Lost twenty: The conditions for getting a bronzinium bust after leaving the Jedi Order are attaining the rank of Master before leaving and not leaving in order to combat the Order (i.e turning to the Sith). The Link stressed that the Jedi did not hold a grudge for them leaving, although that might be slight propaganda and heads right after people left.
Jolee Bindo left the order to be self exiled. Dooku left and retired back to his homeworld, so it seems as long as the Jedi don't pose a threat they can leave. Granted sometimes people like Dooku slip through the cracks though.
In the Path Of The Jedi officially licensed book, a Jedi Initiate may leave if he/she fails to pass their Initiate Trials. Same goes for Padwans who cannot pass their Jedi Knight Trials. The Council may also ask a Jedi Initiate, Jedi Padawan, or even a Jedi Knight to leave should the Council not sense the Force as their destiny or working in their future.
So, presumably, If a Jedi Knight/ Padawan/ Initiate asks to leave then the Council would probably have to take a vote (the book also mentions the Council's word as LAW multiple times throughout so,) and then determine if the request should be denied or granted.
I would also guess that should Anakin have asked he would have been denied because of his connection to the prophecy. Should he truly have wished to leave he could have told them about Padme and how he felt he couldn't be a Jedi without her... Even then I honestly doubt they would let him go... Mace Windu would probably vote to have him leave. But he never liked Anakin anyway. In SW:TOR it was mentioned that the Council has allowed Jedi to marry under special circumstances and I feel that being the Chosen One might certainly count towards a "special circumstance". He would more likely need MUCH MUCH more training in letting go, and in controlling his meddlesome visions. Let's face it, Anakins fall to the dark side was only based upon his vision of Padme's death. Padme only dies because Anakin turned to the Dark Side. Anakin only turns to save Padme... Thus the whole vision was redundant. No vison; no turn; no death; no Vader.
Jedi Apprentice establishes that Obi-Wan nearly didn't become a Jedi at all because no Knights wanted to take him on as a Padawan and set up that Qui-Gon's former padawan had left the order to return to his family and live a life as a noble on his home planet.
During the Clone Wars, Ahsoka Tano was removed from the Order to be tried for treason and was able to refuse readmittance later. Combined with the fact that Anakin was nearly denied entry into the Order period due to being too old set up that not all force sensitives are required to be or even allowed into the Order.
There are also several Jedi, including Kento and Mallie Marek, who left the order to get married, or to pursue other goals, such as Bardan Jusik joining the Mandalorians.