Mr Hammond dismissed reports of angry rows between the two as "tittle tattle" although he jokingly acknowledged he occasionally swore.
Mrs May said she was "focused on 8 June".
Mr Hammond and Mrs May were speaking at a press conference they arranged to attack Labour's election manifesto.
Taking questions from journalists after claiming Labour's pledges created a multibillion pound "black hole", they were asked about reports of a rift between their offices since the U-turn over National Insurance in March's Budget.
Asked by BBC political editor Laura Kuenssberg whether they would "still be neighbours" after the general election - the chancellor's official residence is 11 Downing Street - Mrs May said: "I think it's true to say that the chancellor and I and every other member of my team are focused on 8 June."
She was also pressed to give an endorsement of her chancellor, replying that she was "very happy to do so".
"As Philip says, we have worked together for many years," she said. "Longer than we would care to identify - that's an age-related comment, nothing else."
Mr Hammond said he and Mrs May worked "very closely together".
He added: "What I candidly admitted - and my family will confirm this - is I do occasionally swear."
This morning the chancellor's admission that he sometimes swears, as he sought to play down reports of rows with Team May, won't have helped.
Nor will the PM twice refusing to say he would still be her chancellor if she is elected.
She did, at the third time of asking give him her endorsement.
And moving him after the election if the Tories win would be a dramatic and risky move.
But this morning's excursion won't have helped relations between the two addresses.
Read Laura's blog

A passer-by found the man, who has not been named but was in his 30s, off Promenade Street in Heywood at about 23:25 GMT on Thursday.
He was pronounced dead at the scene and officers are treating the death as suspicious.
A post-mortem examination is due to take place and officers have asked for any witnesses to contact them.

The problem is that so many of the initiatives and ideas sold to the country as ground-breaking prove to be business as usual.
So the Communities Secretary Sajid Javid went out of his way to sound no-nonsense and tough today. He accused some English councils of "fudging" the numbers on housing need in their area and warned them that he was not going to allow that to happen anymore.
But the response to the government's proposals has been decidedly mixed.
Labour's shadow housing minister John Healey described them as "feeble beyond belief".
"Re-treading old ground" was how the National Association of Commercial Finance Brokers described the White Paper.  "Kicking the can down the road," one big investment fund said.
The chief executive of the housebuilder Inland Homes, Stephen Wicks, bemoaned the failure to relax rules on green belt development.
"Brownfield in itself can't possibly sustain the long-term housing requirements of the UK," he said.  "It can go an awful long way but there needs to be a relaxation of some green belt to enable us to deliver the numbers that we are required to do."
The White Paper does include measures to encourage developers, housing associations and councils to build more affordable homes more quickly, both to rent and to buy.
But this government seems to speak with two voices on housing: the communities department wants to shift the balance of power firmly towards new development in places people want to live, but Number 10 and some influential Tory backbenchers are sympathetic to the passionate concerns of those who wish to protect the countryside and particularly the green belt.
The real question that lies behind all the rhetoric and policy bullet-points is whether the balance of power between development and local opposition has fundamentally changed.
Ministers now accept England needs 250,000 new homes every year, they have described the housing market as "broken" and they agree that radical change is the only way to mend it.
But many have yet to be convinced that this White Paper amounts to a "realistic plan" to achieve that.
Prime Minister Theresa May has laughed off questions about whether Chancellor Philip Hammond would still be in place after the general election.
[NEXT_CONCEPT]
Police have launched an investigation after the body of man was found in an alleyway in Rochdale.
[NEXT_CONCEPT]
Over the last three decades, governments of various stripes have promised radical change to solve England's housing crisis and today's White Paper is no exception.