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
Prime Minister Theresa May has laughed off questions about whether Chancellor Philip Hammond would still be in place after the general election.