Each rider accepted for the Championship will be allocated a specific starting number which will be valid for the whole Championship. In general, the starting numbers will be based on the results of the team riders in the previous year's Championship or in other similar events.
So, for example, for 2008, this means that Casey Stoner has the right to display number 1, Dani Pedrosa has the right to display number 2, Valentino Rossi has the right to display number 3, John Hopkins has the right to display number 4, Marco Melandri has the right to display number 5, and so on down the list.
There are a few factors which make using this numbering scheme difficult to operate.
The first is that riders are superstitious. I'm sure you will have noticed that lots of riders have special rituals before they race, such as only getting on the bike from the left-hand side, or lucky colors. They also have lucky numbers, and so when given a choice, the always want to use a particular number. Valentino Rossi is the most famous of these, as he has always used the number 46, even when he was champion and allowed to carry the number 1 plate. But many others have similar superstitions: John Hopkins always wants to keep number 21, Marco Melandri wants number 33.
Of course, this causes problems when it comes to popular numbers, the most difficult of all being number 7, which is a lucky number in a lot of countries. Chris Vermeulen always had a 7 in his number, but really wanted number 7, both as a lucky number, and as a tribute to his friend and mentor Barry Sheene, whose number it used to be. But Carlos Checa had number 7, and so Vermeulen had to wait until Checa left MotoGP before he could take the number 7 plate.
In 2008, Casey Stoner took the number 1 plate, as he finished as champion. But Stoner only took the number after coming under pressure from Ducati, as he really wanted to keep the number he has always raced with, number 27. On the other hand, Dani Pedrosa swapped his regular number, 26, for the number 2 plate, to underline the fact that he finished 2nd in the championship in 2007.
The second reason is one of marketing. Riders become associated with numbers, and therefore all of their merchandising such as t-shirts, caps, badges, stickers, bags etc etc has their race number on, for their fans to identify with. It becomes so important to riders, their teams and their managers, that they are reluctant to take a different number.
There is also a difficulty for riders coming in from other series. In 2007, both Jorge Lorenzo and James Toseland won the world championship in their respective series, and so both have a claim to a number 1 plate. But as they are not champions in MotoGP, and as the champion is already carrying the number 1 plate, they have had to revert to their previous favorite numbers, 48 for Lorenzo and 52 for Toseland.
Finally, one number has been retired and is no longer available. Number 34, which belongs to Kevin Schwantz has been retired, as a mark of respect for Schwantz by the FIM.