Are there any rules regarding parking an RV/Campervan alongside the Tour de France course? Can you just park anywhere that isn't yet closed off? How long before the race comes by do you need to get there? How soon after the race can you leave? I'm asking specifically about stages in the French Alps.
None of this is particularly good news for you I'm afraid.
You can park pretty much anywhere provided there's space, that you're off the road, and that the road isn't already closed.
In an RV, in the Alps, I would think you need to think about being in place the day before. Certainly, they will close the roads to traffic probably no later than breakfast time. But it's not just whether the roads are open, it is whether there is anywhere to park (especially in an Alpine pass).
In general, road restrictions are lifted very shortly after the race has passed - 5 or 10 minutes. But be aware that, at that point in time, the world and his wife are trying to get away, so you're in an instant traffic jam.
Life may get more complicated if you are on a mountain, and the stage has a mountain top finish. If this is the case, expect the teams and the officials to have priority getting down the mountain after the race is over. It wouldn't surprise me if you were held for some time before you could leave.
One thing you can do to try to counter all this is to park a distance away from the route, and then to either walk or cycle. This has worked for me in the past (especially beating traffic afterwards) but may or may not be practical for you. But certainly bicycles tend to be ignored by the gendarmes and you're pretty safe to be riding on the race route until shortly before the caravane passes (an hour or so before the race itself).
Whenever I go to the Tour de France I always come up with a cunning plan to try and beat the crowds, and it is never quite cunning enough, just because there are so many people.
My research suggests that there is no absolute answer to this.
According to Watching the Tour De France in person
If you're planning on camping out on top of the more popular mountains, try to arrive a good two days prior to the race coming through to get a prime parking and/or camping space.
Once you have decided where you would like to see the Tour, check prior to arriving – or with the local tourist office as soon as you arrive – to see which roads are going to be closed (and when).
The race website or local newspaper will have the schedule listing when the race will pass. However this is more for information because on a big mountain stage all the roads are blocked from the morning onwards. The roads close well in advance of the race. There’s no fixed time but on a big mountain stage you can expect the route to be closed at breakfast time to cars. It’s why many will drive up the day before and camp overnight, indeed even if you drive up a climb you’ll find many of the parking places are taken days before by camper vans.
Another site (can't find it right now) said that the Gendarmes can close roads or move you on as they see fit.
So, many people want to see it, and there are no guarantees.