The world champion, 24, moves ahead of Charlotte Dujardin, who won her third Olympic gold with victory in the individual dressage.
"I can't believe it. I didn't expect that at all," said a tearful Trott, who matched her team pursuit and omnium victories from London 2012 in Rio.
She scored 230 points to win the title by 24 from American Sarah Hammer.
Trott finished second in the opening scratch race of the omnium and won the individual pursuit and elimination race to end Monday's opening day with an eight-point lead over Belgium's Jolien D'Hoore, with Hammer in third.
She was second in the time trial to extend her advantage over D'Hoore to 12 points and then won the flying lap to double her lead heading into the 100-lap points race.
Trott, from Cheshunt, concluded the six-discipline event with a tactically astute ride, closing down attacks from her rivals and picking up points in the 10 intermediate sprints.
Find out how to get into cycling with our special guide.
"I couldn't have done it without everyone, especially Paul Manning my coach. He puts up with me on a daily basis and I am over the moon," added Trott, who also won her second world omnium title earlier in the year.
Trott celebrated her latest Olympic gold by cheering on fiance Jason Kenny as he equalled Sir Chris Hoy's British record of six Olympic gold medals by winning a dramatic keirin.
Former Olympic champion Victoria Pendleton: "Laura Trott is incredibly tough and tenacious. She might look fragile but it is the complete opposite of what is going on inside. She always pushes herself to the absolute limit."
Trott's team-mate Joanna Rowsell Shand on BBC One: "Laura has got a 100% record in the Olympics - she rode twice in London and two here in Rio and she has won all four. That must be a record in itself."
Former Olympic champion Chris Boardman on BBC TV: "Laura didn't put a foot wrong in the entire race. She did everything that she needed to do, didn't panic and the battle behind her played right into her hands."
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.
Laura Trott became the first British woman to win four Olympic gold medals by retaining her omnium title.