Media playback is not supported on this device
A day before turning 43, the oldest rider in the event beat Russian Olga Zabelinskaya, who returned from a doping ban last year, by 5.55 seconds.
Dutch rider Anna van der Breggen, winner of the road race, took bronze.
Great Britain's Emma Pooley, who, like Armstrong, came out of retirement to compete in Rio, finished 14th.
Find out how to get into cycling with our special guide.
Pooley, 33, told BBC Radio 5 live she "struggled with the blustery crosswind" on the hilly 29,7km course.
"The weather was a bit different to what we expected," she said. "I had to ditch my visor halfway round because it got steamed up.
"Some people are just better at cornering in the wet, I guess."
Armstrong became the first person to win the same road cycling event at three Olympics.
Having won the time trial at Beijing 2008, she retired in 2009 to start a family before returning to win gold at London 2012 and retiring again.
Media playback is not supported on this device
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.

He is currently the managing director of retail banking for the Ulster Bank group.
Mr Donnan replaces Ellvena Graham, who is becoming a non-executive director of the bank.
She held the position as â€Žhead of Ulster Bank Northern Ireland since it was created just over two years ago.
Ulster Bank is the largest bank in Northern Ireland and the third largest in the Republic of Ireland.
Its chief executive Jim Brown said: "I would like to wish Ellvena well as she departs her executive role.
"She has always been a positive and energetic influence on the business with a solid understanding of what matters for our people and our business.
"She has also been a great support to me personally."
Mr Donnan has been with Ulster Bank for about 25 years.

The yellow-browed warbler was tagged at Pembrey Burrows nature reserve, only the fifth ever recorded in the county.
The birds, known for their "strikingly loud" song, are more commonly found on the east coast of England with 600 recorded this autumn.
Easterly winds this autumn are said to be the reason behind the bird's visit to the reserve.
Yellow-browed warblers breed in Siberia and winter in south-east Asia.
Licensed bird ringer and volunteer ranger Paul Aubrey said the visitor was a highlight of an unexpectedly mild and bright autumnal period.

The two men could not be separated after completing the 31.8-mile (50 km) race in five hours, two minutes and 47 seconds on Sunday.
James Quirk completed the top three, finishing 10 minutes behind the leaders, with Karen Chiarello the leading lady, in fifth.
The course shadows the Parish Walk from Peel to Bride and on to Ramsey.
The event was renamed in 2016 with all proceeds going to the Firefighters Charity, which provides assistance to serving firefighters, retired firefighters and their families.

The "old English white" Jaguar E-Type Series III was driven by comedy characters Del Boy and Rodney in an episode of the BBC series.
In the 1981 episode, the pair borrowed the car from John Challis's character Boycie for a "night on the tiles".
It had been expected to fetch £85,000 in an auction at Blenheim Palace but sold for £115,800.
Finished with a blue leather interior, the 1973 Series III Roadster, owned by a Swansea businessman, includes a die-cast model signed by both David Jason and John Challis.
A 1961 Jaguar car once owned by the company's founder was also due to be auctioned. The Mk X, built in Coventry, belonged to Sir William Lyons and was made to his personal specifications - with a leather interior and rear picnic tables in walnut.
American Kristin Armstrong won the Olympic women's road time trial for the third time in succession with victory in Rio.
[NEXT_CONCEPT]
Ulster Bank has appointed Richard Donnan as its new boss in Northern Ireland.
[NEXT_CONCEPT]
A bird that makes its home over 3,500 miles away in Siberia has made a rare visit to Carmarthenshire.
[NEXT_CONCEPT]
Samuel Fletcher and David Walker finished joint first in the island's FireFighters Memorial Walk.
[NEXT_CONCEPT]
A vintage Jaguar sports car made famous when it featured in Only Fools and Horses has sold for more than £115,000.