As a admin I have created one custom visual force page and apex class.
How can I give permission to a profile to edit that visual force page and apex class?
My 2nd requirement is that only one user has the rights to edit that visual force page and apex class.
How can I give permission for only one user?
You cannot give permissions to edit just one class or page. It is all or none at that level. The permission required is
Author Apexand will allow any user who has this permission all classes and pages (and other things).
As for which users to assign it to, however, you can assign to just one user, but
Profileis not the way to do it. You would instead use
Permission Sets. First add the desired permission, then assign the desired user to it.