Tourist visas can be purchased at any port of entry, so long as you have a valid passport. They cost $25 and are available at currency exchange kiosks preceding the customs and immigration lines.
Your passport should be valid for a minimum period of 6 months from the date of entry into Egypt. The teller will exchange your currency and paste the visa into your passport in just a few minutes. This means you need to ensure that you have at least one blank page to receive the entry stamp.
Regardless of whether you are working, studying or touring in Egypt, you must purchase a tourist/entry visa when you arrive in Egypt. As a tourist, it entitles you to 30 days in the country, and does not allow you to work. If you stay longer than 30 days, you may extend your visa by visiting the office of the Ministry of the Interior (in Cairo these are located in the Mugamma in Tahrir Square).
Tourist visas are only valid for a single entry. That is to say, if you leave Egypt to visit another country and then return, you will have to purchase a new entry visa. This will, however, reset the 30 day count.
Fortunately, if you plan on staying in Egypt for an extended period of time you may renew this initial entry visa as a 6-month temporary residence visa (for touristic purposes). This type of tourist visa is also renewable.