A law which punishes a specific person – a "bill of attainder"– is unconstitutional. Private laws, which benefit an individual, are legal. An example is Private Law 112-1, which says
Notwithstanding any other provision of law, for the purposes of the Immigration and Nationality Act (8 U.S.C. 1101 et seq.), Sopuruchi Chukwueke shall be deemed to have been lawfully admitted to, and remained in, the United States, and shall be eligible for adjustment of status to that of an alien lawfully admitted for permanent residence under section 245 of the Immigration and Nationality Act (8 U.S.C. 1255) upon filing an application for such adjustment of status.
Nothing prevents such a bill from being made law, where the benefit is a grant of citizenship. Of course, it has to be signed by the president, or else congress must override his veto.