When a company does an Initial Public Offering it is making its shares available for purchase by members of the public for the first time. There are two markets - the "primary" and the "secondary" markets (the terminology is a little confusing).
The Primary Market
After going through the procedures of filing with the SEC (e.g. the S-1 document), the underwriter(s) of the offering guarantee that a certain number of shares will be sold at at least a particular price. They find investors who want to participate in the IPO who will pay that required price (or higher). If an insufficient number of investors participate, the underwriter(s) have the obligation to buy the outstanding shares. That is why it is generally large household name banks who underwrite the listings either on their own or as part of a 'syndicate' - they need to have enough capital to cover this obligation.
As a retail customer, you can 'get in' on your IPOs by contacting your broker ahead of time and asking if you can buy the company's stock as part of their IPO. Sometimes a listing is 'oversubscribed' - there are more people who want shares than there are shares available. The IPO does not necessarily take place on an exchange - each offering may have its own rules. The availability of IPO stock may also depend on the relationship your broker has with the underwriters of the offering.
The Secondary Market
Once the IPO has been completed and the price has been set, the purchasers of the company stock are now entitled to sell their shares on the secondary market, for example on an exchange such as the New York Stock Exchange.
Events that Happen During an IPO
First, the underwriter(s) try to get the best price and a commitment to buy all of the IPO stock.
The underwriter(s) performs the IPO and gives the investors their shares at the determined price, according to the procedures set out in the prospectus.
The proceeds go to the company after the underwriter receives their fee.
The investors receive notification of how many shares they have received and at what price.
Once the IPO has completed and the company has met the listing and opening criteria for the exchange, the exchange may open up the ticker symbol for bids and offers. When there is a sufficiently small difference between the bid and offer, the exchange may then open the symbol for trading.
Often times the company who was listed that day get to ring the bell that indicates the close of the market. That is to indicate that the IPO was completed and that trading has commenced and concluded its first day on the secondary market.
Ringing the opening and closing bells is primarily ceremonial. More than one company may be listed on a particular day, and neither of them are obliged to ring the opening or closing bell.
The Open
The Opening Bell and Closing Bell indicate the beginning and ending of the continuous trading sessions (trading can still take place during "after hours" or "pre open" sessions). After the opening bell, the individual stocks may or may not open for trading. Sometimes if the spread is too wide (outside exchange rules) or if the symbol is halted (e.g. news is coming out) then the stock will open later on in the day. It is common for stocks to have intra-day re-openings for one reason or another, though this does not happen every day.
Often the exchange will appoint one or more market makers who are charged with providing sufficiently narrow bids and offers to open the symbol and provide bid and ask prices throughout the day. They need to have sufficient stock to begin doing that.
The rules vary among exchange as to the procedures that take place to open a symbol for trading, either at the beginning of the day, after a halt (e.g. suspension while news is announced) or after an IPO. Typically there is a minimum 'quote width' before trading can commence, and trading commences when the first execution occurs - i.e. someone someone sends an order to buy at the offered price, or someone is willing to sell at the bid price. On NYSE, the price is set by the specialist (another name for market maker) who is the guy (yes, a guy on the floor) displaying the bid ask price. Orders less than 1100 shares sent to NYSE however get executed on an automated system. Other exchanges display the (best) bids and asks offered by other participants, which execute when they match. They however have to honor the opening times on the exchange where the symbol is listed.