In most common passenger aircraft brakes are automatically applied when the gear is retracted.
The wheels stop spinning before they enter the wheel well.
This is particularly important because a spinning damaged tire may cause damage to hydraulic and fuel lines which are usually routed near the wheel bay.
The nose wheels have no brakes, so they are spinning while they are being retracted.
Most aircraft have rubber brake pads (snubbers) fitted in the nose gear bay that stop the spinning of the gear once the wheels are retracted.
aviation.stackexchange.com/users/19/DeltaLima
The question was formulated in the context of a jet liner such as the Boeing 737-800 or the Airbus, I do not understand why there are persons responding to this question in the context of a smaller less complex aircraft.
With that being said, I will like to expand the answer by DeltaLima.
Boeing uses a device attached to the Brake Metering Valve Module called a De-spin Actuator.
This device directs controlled hydraulic fluid to the brakes when the landing gear lever is set to retract to stop the spinning of the wheels.
More information can be found in the AMM ATA 32 (Aircraft Maintenance Manual Chapter on Landing Gear).
https://www.facebook.com/aviationisawesome/videos/1598830786833154/ Video of a 737-500 from inside the main gear wheel
well shows: After becoming airborne, the landing gear suspension unloads and the wheel hangs down, still spinning
Once the main gear arms begin retracting, the wheel stops within a second
The gear has fulled retracted in 6-7 seconds.
De-Spin Actuator Source: http://www.eaton.com/ecm/groups/public/@pub/@eaton/@aero/documents/content/ct_194202.pdf
aviation.stackexchange.com/users/9088/Andres Delgado
These are the "nose wheel spin brake linings" (the braking pads) that stop the spinning of the nose wheel after retraction.
aviation.stackexchange.com/users/42322/J.Torre
I fly retracts and have heard this question a dozen times.
Some people say to tap the brakes, other people (like me) never do.
I have asked certified mechanics, and they have all said it doesn't matter.
My advice is to follow the POH.
If it says tap the brakes, then do so.
Otherwise do or don't it doesn't matter.
aviation.stackexchange.com/users/3504/rbp
General policy when operating a retractable gear aircraft is to apply brake pressure after becoming airborne and prior to commanding the retraction of the landing gear.
This causes the wheel to cease spinning, removing gyroscopic precession loads on the landing gear during retraction (remember a spinning tire acts like a big gyroscope and wants to maintain its orientation in space) as well as reduces the chances of damaging components inside the wheel well when the gear is stowed.
aviation.stackexchange.com/users/15637/Carlo Felicione
Follow the POH is always the best and most correct answer because it is different on different models and types.
I have a 1971 C177RG POH in front of me right now
and it says:
Landing Gear RetractionBefore retracting the landing gear, the brakes should be applied momentarily to stop wheel rotation
aviation.stackexchange.com/users/5565/Ken VeArd
On the 737, the main gear gets gear retract braking pressure when the gear lever is placed in the UP position.
It also doesn't hurt that a heavy brake stack will close up under gravity as the wheels are turned horizontal during retract.
The nose wheels are free to spin up into the wheel well, where they contact a friction brake that drags on the tires; slowing and stopping nose wheel spin.
aviation.stackexchange.com/users/22793/PanNerdicon
What happens to the spinning landing gear right after V 2  on takeoff? Are they automatically or manually braked to a halt before gear retraction? Or are they allowed to spin to a halt in the wheel wells?  I am asking this question in the context of common passenger planes, such as the Boeing 737-800 or the Airbus A320.
What happens to the spinning wheels of the landing gear after takeoff, before retraction?
aviation.stackexchange.com
<takeoff><landing-gear><aircraft-systems>
aviation.stackexchange.com/questions/11178
aviation.stackexchange.com/users/693/Alexander Johansen
Generally wheels stop spinning before they are retracted. The general policy is to brake the wheels before retracting. However, nose wheels have no brakes so they are spinning as they retract. There is a device in the nose gear bay that stops the spinning. Brakes are usually applied automatically when the gear is retracted. Brake pressure is usually applied after take-off and before retraction. Although the wheels stop spinning before entering the wheel well, the nose wheels do not have brakes so they are still spinning during retraction. Boeing planes have a device called a De-spin Actuator. Having said all that, the best answer is to check in the POH because it will vary for different models and types.
In most common passenger planes, the brakes are applied automatically when the gear is retracted. The general policy is to apply brake pressure after take-off before ordering the retraction. Although the wheels stop spinning before entering the wheel well, the nose wheels do not have brakes so they are still spinning during retraction. Most planes have brake pads in the nose gear bay that stop the gear from spinning after the wheels are retracted. Boeing planes have a device called a De-spin Actuator attached to the Brake Metering Valve Module. The best answer is to check in the POH because it will vary for different models and types.