Answers

All you need is, a Facebook account and WAMP server running on
your PC. Steps are quite simple.

Enable curl extension

By default on WAMP curl is disabled. In order to communicate with
Facebook server you need to enable it. All you have to do is, Start
your WAMP server then (left) click on green WAMP icon from system
tray, navigate to PHP then PHP extensions and then check php_curl. You
might need to restart your WAMP server to take effect.

Create a folder for your app on your PC.
= Once you are done with enabling curls, you need to create a folder on your PC for your Facebook app. You can choose any name for it. In
simple, create a new folder named fb inside your www folder of WAMP
server. Then test it by navigating http://localhost/fb . You must
see all your app content here.

Create app on Facebook

Once you are done with above two steps, you are now ready to create an
app on Facebook. Just navigate to Facebook developer’s website and
then from apps menu select Create New App.

Then Facebook will ask you for basic information about your app. You
can choose any desired name and email address but you have to fill
localhost as App Domain and http://localhost/fb as Website with
Facebook login. This will enable login from localhost.

The Problem seems to be, that you have this code in a html-file on your local machine (e.g. Desktop) then it does not work. I tried it.

You have to run this html on Web-Server eg. XAMPP for testing purposes.