To cover 300 meters is too much to ask of normal wifi equipment. The only chance it could work is if you use a directional antenna at each end. I see such equipment is available per an internet search.
So if you're determined to try...
Your best chance is to use the recent 802.11n specification. It has the best distance operation.
Up to 240 meters according to:
IEEE 802.11 - Wikipedia, the free encyclopedia
If your friend's wifi does not operate with 802.11n then you must obtain a card which is able to use the networking specification used by your friend's wireless device. Years ago it was common to see 802.11b. Then more recently 802.11g.
Your wifi card must fit your computer slot. The designations available:
PCI
mini PCI (in types I or II or III)
PCI-x
PCI-e (express)
mini PCIe (mini for laptops)
PCM-CIA (mini for laptops)
etc.
The above types are not compatible in size. But check because maybe PCIe can take the place of PCIx.
You should choose a card with the most sensitive antenna. In fact you should find a directional antenna, or make your own. It has to be optimized for the wifi frequency. Normally 2.4 Ghz and/ or 5 Ghz.
Make sure the card is compatible with your operating system.
You cannot hope for high speed (54 mbps is the fastest in typical home networks). Your radio connection will probably be weak. This causes a link to drop to a slower speed (1 or 2 mbps).
To make a wifi connection at all, you'll need good antennas. Consider mounting them in a second story window. You'll need to aim them directly at each other. Avoid getting tree trunks in the line of sight.