In 1889 the prime minister, Lord Salisbury, announced that an anonymous donor had agreed to fund a new building for the National Portrait Gallery. The donor turned out to be W.H. Alexander, a Gallery Trustee. The present site at St Martin's Lane was chosen, and the building was designed by the architect Ewan Christian, and opened in 1896.
On 1st November 1915, during the First World War, the Gallery was closed to the public and most of the portraits were removed for their safety. They were stored in London Underground stations, at the National Library of Wales, Aberystwyth, and in underground stations of the Post Office Railway Company, a small underground train system used for delivering the post throughout London until 2003. The Gallery building itself was lent to HM Office of Works for the use of the Separation Allowances Department for the duration of the war. In 1918 the portraits were returned to the Gallery, but it was evacuated by the War Office on 25th October 1919. The Gallery gradually reopened during 1920.
Soon after the St Martin's Lane building opened in 1896, it became clear that there was not enough space, and the Trustees began to press for expansion on Orange Street. However, although the Government did agree in principle, no money was made available. A report by the National Commission on Museums and Galleries in 1928 found that the National Portrait Gallery urgently needed an extension. Sir Joseph Duveen, an art dealer and philanthropist, immediately offered to pay for the extension of the Gallery. The Duveen wing extension, on Orange Street, adjoining the Gallery, opened on 30th March 1933.
On 24 August 1939, at the outbreak of the Second World War, the Gallery was again closed to the public and the portraits were removed for their safety. Portraits were moved to Lord Rosebery's estate at Mentmore, Buckinghamshire. They were stored in outbuildings, which became known as 'the refuge'. Temporary housing was also created in the outbuildings for four members of staff, who remained there to care for the portraits, working on a rota of several weeks in London, and several at Mentmore. Conditions were very primitive. Henry Mendelssohn Hake, the Director and Charles Kingsley Adams, then the assistant director, along with their wives, also spent periods living in Mentmore's outbuildings. Several bombs fell in Mentmore's grounds, and two bombs fell on the Gallery, one of which destroyed a staircase and gutted the East Wing, though no one was harmed. A special 'dug out' was created in the Gallery basement to house other portraits that could not be moved, and the basement and ground floor windows were bricked up or sandbagged so that the archive and library could remain there. In 1942 the portraits at Mentmore were repacked and some of them were then moved to a site in the Westwood quarry near Bath, which was also being used by the British Museum. In March 1942 the Gallery reopened intermittently, with small displays relating to war time activities, such as art and handicrafts by armed forces personnel. It permanently reopened on 14th July 1945.
In the 1970s the first floor of the Duveen wing was converted into conservation studios and framing studios, and in 1982 it was gutted to provide a single gallery for temporary exhibitions. In 1971 the National Portrait Gallery took over the lower part of numbers 13-15 Carlton House Terrace, using the space as storage for its reserve collection, and also for temporary exhibitions from 1974-1980, and to house the library and archive from September 1980 to 1986. From 1986-1993 the Archive and Library was housed temporarily at The Mill, Lewisham.
During the 1980s the Gallery looked for much needed expansion space. The site of the Royal Dental Hospital on Leicester Square became vacant and was considered but the proposal was not taken forward because of lack of money. It was also suggested that the Gallery should move onto the site formerly occupied by the Royal Mint, or to the South Bank, but again these proposals did not go ahead.
In 1987 the Government acquired buildings on the north side of Orange Street for the National Portrait Gallery. A competition was held to create a design for this site, and won by Stanton Williams architects. They proposed to build new galleries on Orange Street, linked to the Duveen wing by a bridge, and to create a new piazza and north entrance to the Gallery on Charing Cross Road. However, the proposed design was too expensive.
In 1989 it was suggested that the Gallery should move out of central London and onto an alternative site at Canary Wharf, but this project collapsed at the last minute, meaning that the Gallery still needed more space.
In 1990 the entrance hall to the Ewan Christian building was redecorated, to make it more dramatic, by the architect Roderick Gradidge. It was also decided to convert the buildings on Orange Street into an administrative block, which would free up space in the main building for extra galleries. In 1993 the Orange Street and No. 1 Charing Cross Road office development was completed and the Heinz Archive & Library, now situated in Orange Street, was opened to public. The Heinz Archive and Library brought together all the Gallery's research resources for the first time, and was funded by the Henry J and Drew Heinz Foundation. The ground floor of the Ewan Christian building was redeveloped, and transformed from offices into the twentieth century galleries in 1993, by the architects John Miller and Partners. The ground floor of the Duveen Wing was also converted into a gallery for temporary exhibitions, the Wolfson Gallery, financed by the Wolfson Foundation, and the first floor of the Duveen Wing was completely remodelled in 1996, to provide more space and a better display for Victorian and early twentieth century galleries.
In 1994 an architectural competition to create a 'masterplan' for Gallery development was won by the architects Jeremy Dixon and Edward Jones. They created the Ondaatje Wing, inserted into the narrow courtyard between the National Gallery and the National Portrait Gallery. This wing comprises an extension to the entrance hall, escalator access to the upper floors, a basement lecture theatre, additional gallery space and a restaurant on the top floor. Because this scheme blocked out the National Gallery's natural light, The National Portrait Gallery proposed to cede its East Wing, opening onto St Martin's Lane, to the National Gallery. This scheme was approved and the building went ahead. The National Portrait Gallery continues to use the ground floor of the East Wing for the gift shop, for a peppercorn rent. The funding for the new development came mainly from a private donation from the philanthropist Sir Christopher Ondaatje, with further funding from the National Lottery. It opened in 2000.
The National Portrait Gallery also has space outside London, in the form of its regional partners. These are Montacute House, in Somerset, which opened in 1975, Beningbrough Hall, in Yorkshire, which opened in 1979 and Bodelwyddan Castle, in North Wales, which opened in 1988.