He said he had "let people down" after photos emerged of him with Gina Coladangelo - whom he appointed - and he was "very sorry".
Labour urged the PM to sack Mr Hancock, calling his position "untenable".
But Downing Street said Boris Johnson accepted Mr Hancock's apology and considered the matter closed.
A spokesman added that the prime minister had full confidence in the health secretary.
The Sun reported that its pictures of Mr Hancock and Ms Coladangelo, who are both married with three children, had been taken inside the Department of Health on 6 May.
Social distancing at work is not a legal requirement, but the government recommends that people keep 2m apart where possible - or 1m with "risk mitigation", such as standing side-by-side or wearing masks.
Housing Secretary Robert Jenrick said his cabinet colleague was "right to apologise" and he should now be allowed to get on with his job as health secretary.
He told BBC Radio's 4 Any Questions programme: "There's a task to be done, Matt is on the job doing that, and I think we should allow him to get on with the job."
He added: "The rules have been hard. It is everybody's duty to follow the rules, but equally I've not been somebody who has criticised and condemned people when they've made mistakes."
Labour's Emily Thornberry, the shadow international trade secretary, told the same programme that Mr Hancock's actions showed "an arrogance that they believe they're above the law", adding that "he should have gone a long time ago".
"What we're talking about is somebody breaking the rules for which they were personally responsible - where they were on television night after night telling us that we weren't allowed to have intimate contact with people from outside our households," she said.
And a Labour spokesperson said the matter was "definitely not closed, despite the government's attempts to cover it up".
The government believes no laws were broken because Mr Hancock and Ms Coladangelo were both in the department for legitimate work purposes, sources say.
The Liberal Democrats called on Mr Hancock to resign and accused him of "hypocrisy" over social distancing.
Boris Johnson doesn't do ministerial resignations.
He resists calls from the opposition, the media - and even his own colleagues.
His then aide Dominic Cummings wasn't sacked last spring for his 260-mile trip to Durham during lockdown.
Unlike with Mr Cummings, there has been no cacophonous clamour from Mr Hancock's Conservative colleagues for him to go straight away.
But there are concerns that he won't have credibility in the Commons or in the country to argue that the existing restrictions should be respected.
And in retaining Mr Hancock in office, Boris Johnson has enabled political opponents to revive an attack which they believe has resonance with voters: that there is one rule for ministers - and another for everyone else.
The Covid-19 Bereaved Families for Justice group said it was "heartbreaking" that Mr Hancock had been "ignoring the rules while we were unable to hug friends and family at our loved ones' funerals".
The group wrote to the prime minister, saying that if the health secretary was "unable to find the decency to do the right thing and resign his position, it is paramount that you relieve him from it".
In a statement, Mr Hancock, 42, said: "I accept that I breached the social distancing guidance in these circumstances. I have let people down and am very sorry.
"I remain focused on working to get the country out of this pandemic, and would be grateful for privacy for my family on this personal matter."
The Metropolitan Police said it was not investigating Mr Hancock over alleged breaches of Covid regulations as it didn't investigate Covid-related issues retrospectively "as a matter of course".
The force added it was aware of the images alleged to have been obtained within official government premises but "at this time this remains a matter for the relevant government department".
Ms Coladangelo, a friend of the health secretary since they worked on a student radio station at Oxford University, was made a non-executive director of the Department of Health last September.
The role comes with a £15,000 salary and involves 15 to 20 days of work per year.
Labour deputy leader Angela Rayner has written to the cabinet secretary - the UK's most senior civil servant - asking him to investigate whether Mr Hancock broke ministerial rules by failing to "declare that he was engaged in a relationship with someone whom he personally appointed at taxpayers' expense".
A government spokesman said Ms Coladangelo's appointment had been "made in the usual way" and had "followed correct procedure".
The Times has reported that Mr Hancock failed to declare their friendship when appointing Ms Coladangelo - who is also communications director for fashion retailer Oliver Bonas - as an adviser in March last year.
She held the role for six months, before she was appointed to the Department of Health's non-executive board.
In May last year, epidemiologist Prof Neil Ferguson resigned from the government's scientific advisory group (Sage) after it emerged he had broken lockdown rules when a woman he was reportedly in a relationship with visited his home.
At the time Mr Hancock called these actions "extraordinary", adding that social distancing rules were "there for everyone" and "deadly serious".
On Friday, Labour's First Minister of Wales, Mark Drakeford, said Mr Hancock had been "quick to condemn", adding: "We can't make laws for other people and not be willing to abide by them yourself."
But Mr Hancock's colleagues rallied around him, with International Development Secretary Liz Truss telling the BBC: "[Mr Hancock] does have my support."
Transport Secretary Grant Shapps said there was "a complete difference between what people do in their job... and what they do in their personal lives".
However, Conservative backbench MP Andrew Bridgen said that if the health secretary felt that the revelations over Ms Coladangelo had "affected his performance of his role" he should consider his position.
Mr Hancock has been married for 15 years to Martha, who is an osteopath.
Ms Coladangelo, 43, is married to Oliver Bonas founder Oliver Tress.