In Fontographer 5, I have made more versions of the same typeface (regular, italic and bold), but they are separate files.
How can I make them be one unified file and that when writing in a program (Pages, Word, ...) the user can choose bold or italic then?
These relationships between fonts in a family are called "Styling links".
The simple answer is that if you are outputting OpenType TT or OpenType PS format, and have up to four fonts in the family, all you have to do is give the fonts an identical Family Name the same and different Style Names.
You should also specify width, weight and slope Design Parameter values.
The full answer, which takes into account the differences between output formats, large family support, support for different systems (e.g. WPF versus older Windows apps) can be found in the Fontographer manual (available here), under 'Generating and Exporting Fonts' and Creating a Font Family' sections.
(per suggestion, I'm making my comment an answer):
You don't. They are meant to be separate files, as they are separate fonts. The DTP software is what swaps them out as needed. It's been a while since I've used Fontographer, but I believe the key is that you want all the files to share the same 'family name' setting
As DA01 stated, the connection is based on family name. That links them in the editor. Styles and style names for each font is what determines the switching by word processors and DTP software. Unfortunately, it's not always the same from one app to the next. Stick with basic style labels to avoid trouble.
There are also numeric values for weight that come into play in some instances, since style names can be hard to follow. This is the usual format, in my experience: 200-300 for 'light', 400 for 'regular', 700 for 'bold', 900 for 'black'.