Inclusion Criteria:  The subject (or legally acceptable representative if applicable) provides written informed consent for the trial Male and female subjects who are at least 18 years of age on day of signing informed consent with histologically and cytologically documented diagnosis as gastric or gastroesophageal adenocarcinoma Has a documented, previously treated, advanced (unresectable and/or metastatic) gastroesophageal adenocarcinoma that is incurable and for which prior first-line or later-line standard of care (SOC) treatments have failed. Prior neoadjuvant or adjuvant therapy included in initial treatment may not be considered first- or later-line SOC treatment unless such treatments were completed less than 12 months prior to the current tumor recurrence Has submitted an evaluable tissue sample for biomarker analysis from a newly obtained irradiated. The tumor tissue submitted for analysis must be from a single tumor tissue specimen and of sufficient quantity and quality to allow biomarker study (see laboratory manual). A "newly obtained" tumor specimen, defined as a specimen obtained up to 6 weeks (42 days) prior to initiation of treatment on day 1, for biomarker characterization will be required for enrollment of all subjects. Tissue from tumor progressing at a site of prior radiation (at least 6 weeks interval after last radiation) may be allowed for biomarker characterization upon agreement from Merck. Subjects for whom newly-obtained samples cannot be provided (e.g., inaccessible or subject safety concern) may submit an archived specimen only upon agreement from the Merck Has measurable disease based on RECIST 1.1 as assessed by the Investigator. Lesions situated in a previously irradiated area are considered measurable if progression has been demonstrated in such lesions Has a performance status of 0 or 1 on the Eastern Cooperative Oncology Group (ECOG) performance scale within 5 days of starting study treatment Has a life expectancy of greater than 3 months per the judgment of the investigators Has adequately controlled blood pressure (BP) with or without antihypertensive medications, defined as BP =< 150/90 mm Hg at screening and no change in antihypertensive medications within 1 week of cycle 1 day 1 Absolute neutrophil count (ANC) >= 1,500/uL (specimens must be collected within 5 days prior to the start of study treatment) Platelets >= 100,000/uL (specimens must be collected within 5 days prior to the start of study treatment) Hemoglobin >= 9 g/dL or >= 5.6 mmol/L without transfusion or EPO dependency (within 7 days of assessment) (specimens must be collected within 5 days prior to the start of study treatment)  Serum creatinine =< 1.5 x upper limit of normal (ULN) OR measured or calculated creatinine clearance (GFR can also be used in place of creatinine or CrCl) >= 60 mL/min for subject with creatinine levels > 1.5 x institutional ULN (specimens must be collected within 5 days prior to the start of study treatment)  Creatinine clearance should be calculated per institutional standard Total bilirubin < 1.5 x ULN OR direct bilirubin =< ULN for subjects with total bilirubin levels > 1.5 x ULN (specimens must be collected within 5 days prior to the start of study treatment) Aspartate aminotransferase (AST) (serum glutamic oxaloacetic transaminase [SGOT]) and alanine aminotransferase (ALT) (serum glutamic pyruvic transaminase [SGPT]) =< 2.5 x ULN OR =< 5 x ULN for subjects with liver metastases (specimens must be collected within 5 days prior to the start of study treatment) Albumin >= 2.5 mg/dL (specimens must be collected within 5 days prior to the start of study treatment) International normalized ratio (INR) or prothrombin time (PT) activated partial thromboplastin time (aPTT) =< 1.5 x ULN unless subject is receiving anticoagulant therapy as long as PT or PTT is within therapeutic range of intended use of anticoagulants (specimens must be collected within 5 days prior to the start of study treatment)  Male subjects are eligible to participate if they agree to the following during the intervention period and for at least 30 days after the last dose of lenvatinib  Be abstinent from heterosexual intercourse as their preferred and usual lifestyle (abstinent on a long term and persistent basis) and agree to remain abstinent OR  Must agree to use contraception unless confirmed to be azoospermic (vasectomized or secondary to medical cause) as detailed below:  Agree to use a male condom plus partner use of an additional contraceptive method when having penile-vaginal intercourse with a women of child birth potential (WOCBP) who is not currently pregnant. Note: Men with a pregnant or breastfeeding partner must agree to remain abstinent from penile-vaginal intercourse or use a male condom during each episode of penile-vaginal penetration. Please note that 30 days after lenvatinib is stopped, if the subject is on pembrolizumab only, no male contraception measures are needed  A female subject is eligible to participate if she is not pregnant or breastfeeding, and at least one of the following conditions applies:  Is not a WOCBP OR Is a WOCBP and using a contraceptive method that is highly effective (with a failure rate of < 1% per year) and has a low user dependency, or is abstinent from heterosexual intercourse as their preferred and usual lifestyle (abstinent on a long term and persistent basis), as described in Appendix 12.8 during the intervention period and for at least 120 days post pembrolizumab or 30 days post lenvatinib, whichever occurs last. The investigator should evaluate the potential for contraceptive method failure (i.e., noncompliance, recently initiated) in relationship to the first dose of study intervention A WOCBP must have a negative highly sensitive pregnancy test (urine or serum as required by local regulations) within 24 hours before the first dose of study intervention If a urine test cannot be confirmed as negative (e.g., an ambiguous result), a serum pregnancy test is required. In such cases, the subject must be excluded from participation if the serum pregnancy result is positive The investigator is responsible for review of medical history, menstrual history, and recent sexual activity to decrease the risk for inclusion of a woman with an early undetected pregnancy  Exclusion Criteria:  Is currently participating in or has participated in a study of an investigational agent or used an investigational device within 4 weeks prior to the first dose of study treatment.  Note: Subjects who have entered the follow-up phase of an investigational trial may participate as long as it has been 4 weeks after the last dose of the previous investigational agent Has a diagnosis of immunodeficiency or is receiving systemic steroid therapy (in dosing exceeding 10 mg daily of prednisone equivalent) or any other form of immunosuppressive therapy within 7 days prior to the first dose of trial treatment  Has had major surgery within 3 weeks prior to first dose of study interventions.  Note: Adequate wound healing after major surgery must be assessed clinically, independent of time elapsed for eligibility Has preexisting >= grade 3 gastrointestinal or non-gastrointestinal fistula  Has urine protein >= 1 g/24 hours.  Note: subjects with proteinuria >= 2+ (>= 100 mg/dL) on urine dipstick testing/urinalysis will undergo 24-hour urine collection for quantitative assessment of proteinuria Has significant gastrointestinal malabsorption, gastrointestinal anastomosis, or any other condition that might affect the absorption of lenvatinib  Has radiographic evidence of encasement or invasion of a major blood vessel, or of intratumoral cavitation.  Note: The degree of proximity to major blood vessels should be considered because of the potential risk of severe hemorrhage associated with tumor shrinkage/necrosis following lenvatinib therapy Has clinically significant hemoptysis or tumor bleeding within 2 weeks prior to the first dose of study drug Significant cardiovascular impairment within 12 months of the first dose of study drug: such as history of congestive heart failure greater than New York Heart Association (NYHA) Class II, unstable angina, myocardial infarction or cerebrovascular accident (CVA) stroke, or cardiac arrhythmia associated with hemodynamic instability Prolongation of corrected QT (QTc) interval to > 480 ms Has left ventricular ejection fraction (LVEF) below the institutional (or local laboratory) normal range as determined by multi-gated acquisition scan (MUGA) or echocardiogram (ECHO) Has known intolerance or severe hypersensitivity (grade >= 3) to pembrolizumab, lenvatinib, or any of their excipients Has received prior therapy with lenvatinib, an anti-PD-1, anti-PD-L1, or anti PD-L2 agent, a VEGFR2 agent, or with an agent directed to another stimulatory or co-inhibitory T-cell receptor (e.g., CTLA-4, OX-40, CD137)  Has received prior systemic anti-cancer therapy including investigational agents within 4 weeks or 5 times the half-life time, whichever is shorter prior to allocation.  Note: Subjects must have recovered from all adverse events (AEs) due to previously therapies to =< grade 1 or baseline. Subjects with =< grade 2 neuropathy may be eligible  Has received prior radiotherapy within 2 weeks prior to study day 1.  Note: Subjects must have recovered from all radiation-related toxicities, not require corticosteroids, and not have had radiation pneumonitis. A 1-week washout is permitted for palliative radiation (=< 2 weeks of radiotherapy) to non-central nervous system (CNS) disease  Has a known additional malignancy that is progressing or requires active treatment.  Note: Subjects with basal cell carcinoma of the skin, squamous cell carcinoma of the skin, or carcinoma in situ (e.g., breast carcinoma, cervical cancer in situ) that have undergone potentially curative therapy are not excluded Has known active central nervous system (CNS) metastases and/or carcinomatous meningitis. Subjects with previously treated brain metastases may participate provided they are radiological stable (i.e., without evidence of progression for at least 4 weeks by repeat imaging (note that the repeat imaging should be performed during study screening), clinically stable and without requirement of steroid treatment for at least 14 days prior to the first dose of trial treatment. This exception does not include carcinomatous meningitis which is excluded regardless of clinical stability Has an active autoimmune disease that has required systemic treatment in the past 2 years (i.e., with use of disease modifying agents, corticosteroids or immunosuppressive drugs). Replacement therapy (e.g., thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic treatment and is allowed Has symptomatic ascites or pleural effusion. A subject who is clinically stable following treatment for these conditions (including therapeutic thoraco- or paracentesis) is eligible Has a history of (non-infectious) pneumonitis that required treatment with steroids or has current pneumonitis Has an active infection requiring systemic therapy Has a history or current evidence of any condition, therapy, or laboratory abnormality that might confound the results of the trial, interfere with the subject's participation for the full duration of the trial, or is not in the best interest of the subject to participate, in the opinion of the treating investigator Has known psychiatric or substance-abuse disorders that would interfere with cooperation with the requirements of the trial Is pregnant or breastfeeding or expecting to conceive or father children within the projected duration of the trial, starting with the screening visit through 120 days after the last dose of trial treatment Has a known history of human immunodeficiency virus (HIV) (HIV 1/2 antibodies). No HIV testing is required unless mandated by local health authority Had an allogenic tissue/solid organ or hematologic transplant Has a known history of hepatitis B virus (HBV; hepatitis B surface antigen [HBsAg] reactive) or known active hepatitis C virus (HCV ribonucleic acid [RNA] [qualitative] is detected) infection. No testing for hepatitis B and hepatitis C is required unless mandated by local health authority Has received a live or live-attenuated vaccine within 30 days before the first dose of study intervention. Administration of killed vaccines are allowed